-
Notifications
You must be signed in to change notification settings - Fork 0
/
statsViewController.m
65 lines (51 loc) · 1.99 KB
/
statsViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// statsViewController.m
// raidersvres
//
// Created by Jon Hollan, Mark Hoffman Brandon Ball on 12/13/15.
// Copyright (c) 2015 GroupProject. All rights reserved.
//
#import "statsViewController.h"
#import "MainScreen.h"
@interface statsViewController ()
{
NSNumber* resCount;
NSNumber* citCount;
NSNumber* farmerCount;
NSNumber* heroCount;
NSNumber* leaderCount;
NSNumber* defenceCount;
NSNumber* charismaCount;
}
@end
@implementation statsViewController
-(void) viewWillAppear:(BOOL)animated
{
NSUserDefaults* sdefaults = [NSUserDefaults standardUserDefaults];
resCount = [sdefaults objectForKey:@"ResidentCount"];
citCount = [sdefaults objectForKey:@"CitizenCount"];
farmerCount = [sdefaults objectForKey:@"FarmerCount"];
heroCount = [sdefaults objectForKey:@"HeroCount"];
leaderCount = [sdefaults objectForKey:@"LeaderCount"];
defenceCount = [sdefaults objectForKey:@"DefenceTotal"];
charismaCount = [sdefaults objectForKey:@"CharismaTotal"];
self.citizenCountLabel.text = [NSString stringWithFormat:@"%@", citCount];
self.residentCountLabel.text = [NSString stringWithFormat:@"%@", resCount];
self.farmerCountLabel.text = [NSString stringWithFormat:@"%@", farmerCount];
self.heroCountLabel.text = [NSString stringWithFormat:@"%@", heroCount];
self.leaderCountLabel.text = [NSString stringWithFormat:@"%@", leaderCount];
self.defenceCountLabel.text = [NSString stringWithFormat:@"%@", defenceCount];
self.charismaCountLabel.text = [NSString stringWithFormat:@"%@", charismaCount];
}
- (void)viewDidLoad {
[super viewDidLoad];
UIImage* _backGround = [UIImage imageNamed:@"subtabbackground.png"];
UIImageView* _backGroundView = [[UIImageView alloc] initWithImage:_backGround];
_backGroundView.frame = self.view.frame;
[self.view addSubview:_backGroundView];
[self.view sendSubviewToBack:_backGroundView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end