-
Notifications
You must be signed in to change notification settings - Fork 2
/
SettingsViewController.m
58 lines (46 loc) · 1.4 KB
/
SettingsViewController.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
//
// SettingsViewController.m
// AppStoreRanking
//
// Created by Kevin Gibbon on 12-07-16.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "SettingsViewController.h"
@interface SettingsViewController ()
@end
@implementation SettingsViewController
@synthesize editField;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
editField.text = [NSString stringWithFormat:@"%i",[defaults integerForKey:@"numreviewtodownloads"]];
}
- (void)viewDidUnload
{
[self setEditField:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (IBAction)editingFinished:(id)sender {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:[editField.text intValue] forKey:@"numreviewtodownloads"];
[defaults synchronize];
[[self navigationController] popViewControllerAnimated:YES];
}
- (IBAction)editFieldTouched:(id)sender {
NSLog(@"test");
}
@end