NSBeginAlertSheet and its thread
NSBeginAlertSheet and its thread
- Subject: NSBeginAlertSheet and its thread
- From: Yorh <email@hidden>
- Date: Wed, 14 Jun 2006 10:20:53 +0200
Hi to all,
I have a question about NSBeginAlertSheet.
I developed an app that use this type of panel to display an error.
My Application is multithreaded and I checked it with Thread Viewer.
When I start the application I have 5 threads running and I made a
method to close the window and to stop the window thread.
-(BOOL)windowShouldClose:(NSWindow*)sender{
NSLog (@"chiudo la connessione e la finestra");
isConnected = NO;
[socket disconnect];
isThreadFinished = YES;
return YES;
}
When I press the close button the windowshouldclose method is invoked
and my thread ends.
When the app returns an error I display the error in this way:
NSString * msg = [NSString stringWithFormat:@"Error %@ %d %@",[err
domain], [err code], [err localizedDescription]];
SEL sel = @selector(sheetClosed:returnCode:contextInfo:);
NSBeginAlertSheet(@"Disconnected",@"Close",nil,nil,[self
window],self,sel,NULL,[self window],msg,nil);
The sheet start and I see in thread viewer another thread running.
If I push the close button, my main window close, but the alert pane
thread continue to run....
How can I stop that thread?
I thought the OS should do it for me!
Thank you all
Yorh
_______________________________________________
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