Hi,
I have an iPad application that builds and runs perfectly the first time. But if I exit the application and open it again, the interface is completely unresponsive. If I exit and open another time, it never gets past the splash screen.
What's strange is that if I wait a minute or two before opening it again, it always runs fine.
Any ideas on what might be going on or where I should start my debugging efforts? I would throw in breakpoints and see what's going on, but by the time I start the application a second time, the debugger has already exited. Is there a way to keep the debugger and console running through multiple executions of an app?
Thanks,
Luke
Edit: Here's some code I use for NSUserDefaults - could this be the problem?
In viewDidLoad
in my main view controller:
bgnum = [prefs integerForKey:@"bgnum"];
menuVisible = [prefs boolForKey:@"menuVisible"];
songTitles = [[NSMutableArray alloc] initWithArray:[prefs arrayForKey:@"songTitles"]];
numberOfSongs = [prefs integerForKey:@"numberOfSongs"];
In viewWillDisappear
:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
[prefs setBool:menuVisible forKey:@"menuVisible"];
[prefs setInteger:bgnum forKey:@"bgnum"];
[prefs setObject:songTitles forKey:@"songTitles"];
[prefs setInteger:numberOfSongs forKey:@"numberOfSongs"];
[prefs synchronize];