- (IBAction)save:(id)sender {
NSUserDefaults *defautls = [NSUserDefaults standardUserDefaults];
[defautls setObject:@"LayneCheung" forKey:@"name"];
[defautls setBool:YES forKey:@"isBool"];
[defautls setInteger:5 forKey:@"num"];
[defautls synchronize];
}
- (IBAction)reader:(id)sender {
NSString *str = [[NSUserDefaults standardUserDefaults] objectForKey:@"name"];
BOOL isBool = [[NSUserDefaults standardUserDefaults] boolForKey:@"isBool"];
NSInteger num = [[NSUserDefaults standardUserDefaults] integerForKey:@"num"];
NSLog(@"name =%@-isBool=%d-num=%ld",str,isBool,num);
}