Re: Progress Sheet on a NSDocument
Re: Progress Sheet on a NSDocument
- Subject: Re: Progress Sheet on a NSDocument
- From: Uli Kusterer <email@hidden>
- Date: Sun, 25 Mar 2007 22:38:51 +0200
Am 25.03.2007 um 20:56 schrieb Adam R. Maxwell:
On Mar 25, 2007, at 11:44, Nick Zitzmann wrote:
On Mar 25, 2007, at 9:17 AM, Uli Kusterer wrote:
GUI in Cocoa is not thread safe. Period.
That's not 100% true; NSProgressIndicator is thread-safe, and a
few other AppKit methods are as well. There used to be a page on
ADC explaining what worked, but I can't find it anymore...
<http://developer.apple.com/documentation/Cocoa/Conceptual/
Multithreading/articles/CocoaSafety.html> indicates that NSView and
NSWindow may be used from secondary threads (with some caveats).
Yeah, but
You should create, destroy, resize, move, and perform other
operations on NSView objects only from the main thread of an
application.
is effectively not thread-safe for all it's worth. Yes, you can draw
in them, but that's it. *perform other operations* is such a wide
term, that it's really no fun doing stuff from other threads.
Especially not the things the original poster was trying to do.
Similarly,
There is some possibility that window objects may leak in an
application that deals with a lot of windows concurrently.
doesn't make me feel it's safe enough to try threaded windows in my
software yet. With all those caveats, performSelectorOnMainThread:
generally makes for a lot less headache with the current state of
Cocoa threading in the GUI.
But yeah, I guess I could have stated this a tad less absolute.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
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