Okay, so from fresh (app not previously installed on the iPhone simulator), the app boots up fine. Then I press the home button and click on the icon and it also is fine. Then if I press the home button, then close the app from the multitasking bar, then press the icon I get the SIGKILL error.
However, when I press run in Xcode it ALWAYS works flawlessly without fail (even after I have close it from the multitasking bar, where pressing the icon fails). Is this just a quirk with the simulator? This behaviour has only begun after I have implemented some NSUserDefault stuff, to remember it's state etc. It does remember all of the defaults though, when it works.
Any help is appreciated.
EDIT:
- (void)viewDidLoad
{
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:1], @"firstRun",
nil];
[defaults registerDefaults:appDefaults];
if ([[defaults objectForKey:@"firstRun"] intValue] == 1) {
//do the stuff required at first launch
table = [NSMutableArray array];
Stocks =[NSMutableArray array];
Money =1234.56;
mem=@"GOOG";
[defaults setDouble:Money forKey:@"money"];
[defaults setObject:mem forKey:@"ticker"];
[defaults synchronize];
self.Input.text=mem;
- (void)viewWillAppear:(BOOL)animated
{
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
if ([[defaults objectForKey:@"firstRun"] intValue] == 0) {
[self entered:nil];
} else if ([[defaults objectForKey:@"firstRun"] intValue]== 1){
[defaults setObject:[NSNumber numberWithInt:0] forKey:@"firstRun"];
[defaults synchronize];
}
[super viewWillAppear:animated];
}
Here is what I think may be relavent regarding NSUserDefaults in my MainViewController (I don't use UserDefaults in any other viewController).
I also do a few setObjects/synchronizes in a few other methods, but they only execute when a button is clicked (which doesn't happen when it crashes).