i am having a problem with my application,.i have this code in my mainviewcontroller viewdidload method to check weather the application launch for the first time
NSUserDefaults *padFactoids;
int launchCount;
padFactoids = [NSUserDefaults standardUserDefaults];
launchCount = [padFactoids integerForKey:@"launchCount" ] + 1;
[padFactoids setInteger:launchCount forKey:@"launchCount"];
[padFactoids synchronize];
NSLog(@"number of times: %i this app has been launched", launchCount);
if ( launchCount == 1 )
{
NSLog(@"this is the FIRST LAUNCH of the myBibleapp");
// do stuff here as you wish
UIScrollView_PagingViewController *detailViewController = [[UIScrollView_PagingViewController alloc] initWithNibName:@"UIScrollView_PagingViewController" bundle:nil];
//detailViewController.firstString = firstString;
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
if ( launchCount == 2 )
{
// do stuff here as you wish
NSLog(@"this is the SECOND launch of the myBibleapp");
// do stuff here as you wish
}
if the app launch for the first time it will go to the UIScrollView_PagingViewController page,or stay in the mainviewcontroller,my problem is i need to unhide a tick image in the maincontroller to statsfy some conditions when the app is launched for the first time.that menz tickimage.hidden = NO; ,i put this in first condition but i am getting nothing unhide from the code.how to do this.
Thanks in advance.
First of all, you need to learn how to use breakpoints and debugging techniques in XCode. I suggest you go and read up on them first…..
… Back already? Good. I hope you understand those concepts now. Here’s what you need to do
padFactoids = [NSUserDefaults standardUserDefaults];padFactoidsandlaunchCount.padFactoidsa valid object? Is launchCount the value you expected?