Skip to content

Instantly share code, notes, and snippets.

@bartolsthoorn
Created June 13, 2011 08:07
Show Gist options
  • Save bartolsthoorn/1022449 to your computer and use it in GitHub Desktop.
Save bartolsthoorn/1022449 to your computer and use it in GitHub Desktop.
EXC_BAD_ACCESS
- (void)viewDidLoad
{
[super viewDidLoad];
[NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(onTimer) userInfo:nil repeats:YES];
if (![[NSUserDefaults standardUserDefaults] objectForKey:kCurrentPage]) {
[[NSUserDefaults standardUserDefaults] setInteger:1 forKey:kCurrentPage];
currentPage = 1;
} else {
currentPage = [[NSUserDefaults standardUserDefaults] integerForKey:kCurrentPage];
}
}
- (void)onTimer {
NSLog(@"Current page is %@", currentPage);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment