Re: [SOLVED!] Progress Sheet on a NSDocument
Re: [SOLVED!] Progress Sheet on a NSDocument
- Subject: Re: [SOLVED!] Progress Sheet on a NSDocument
- From: James Bucanek <email@hidden>
- Date: Sun, 25 Mar 2007 09:47:49 -0700
Alan Smith wrote on Sunday, March 25, 2007:
>Hi everyone,
>
>I've played with it some more and found that the problem is that I'm
>calling the displaying from the savePanelDidEnd::: callback that I set
>for my save panel. The only difference between calling it there and
>anywhere else is that perhaps NSSavePanel detaches a new thread with
>the callback as the method.
Unlikely, and easily verifiably in the debugger. Set a breakpoint and see what thread it is.
It is possible that save panel hasn't been ordered out before you tried to start the next one? If I remember correctly, if you don't call [panel orderOut:] in your didEndSelector/savePanelDidEnd method, the panel won't actually be ordered out until you return. As I remember, trying to nest panels is a bad idea and that's exactly what you might be ending up with.
>The fix is to use performSelectorOnMainThread: in savePanelDidEnd:::
>and all is as Apple says it should be.
You may have inadvertently fixed the problem by simply queuing up a message that won't be executed until the next time through the event loop, which would be after the savePanelDidEnd returns and the panel was dismissed.
--
James Bucanek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden