Crash after an NSNotification is posted
Crash after an NSNotification is posted
- Subject: Crash after an NSNotification is posted
- From: Peter Browne <email@hidden>
- Date: Sun, 28 Nov 2004 12:09:52 +0000
I have an application that on startup runs through a mock 'loading' animation. When the animation finishes, an NSNotification is posted alerting those classes that need to know. Equally, when the user chooses 'Quit' an animation sequence runs through before the application actually terminates. If the user chooses quit BEFORE the loading animation has finished (and therefore before the notification has been posted), then everything works fine.. the loading animation stops, and the shutdown animation begins. But if the user chooses 'quit' AFTER the loading animation has finished and the notification been posted, the program suddenly quits with signal 10 (SIGBUS). I can only assume the problem is with the notification posting, as the shutdown animation worked fine before i added the code for the notifications. The problem seems to lie in this method (the custom 'Quit' action). The first NSLog is displayed, but the program chokes before it gets to the next lot of NSLogs. Any ideas?
- (id)sender
{
[IDcenter release];
NSLog(@"Released notification center thing");
shutdownSequenceTimer = [[NSTimer scheduledTimerWithTimeInterval:0.5
target:self
selector:@selector(shutdownTimerFired:) // Runs the shutdown animation until all buttons are disabled, then terminates app
userInfo:nil repeats:YES]
retain];
if ([loadingSequenceTimer isValid]) { // Checks to see if quit was called before the start up text animationhad finished
[loadingSequenceTimer invalidate];
[loadingSequenceTimer release];
}
i = 1;
[MFDtabView selectTabViewItemWithIdentifier:@"5"]; // Changes the view to the shutdown screen
[synth startSpeakingString:@"Fam Cats control system shutting down."];
NSLog(@"\n");
NSLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
NSLog(@"Beginning shutdown sequence.");
NSLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
NSLog(@"\n");
[quitMenuItem setAction:nil]; // Prevent the user from choosing 'quit' again
}
Thanks in advance, Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden