• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSBeginAlertSheet and its thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Embedding a color item in an NSTableView
  • Next by Date: Re: Drawing text on top of a progress bar
  • Previous by thread: Re: Friendly hint with Font Manager and IB. (Was: Re: Doc App - Errors closing an document.)
  • Next by thread: Transparent white NSView
  • Index(es):
    • Date
    • Thread