Re: Sublclassing NSThread
Re: Sublclassing NSThread
- Subject: Re: Sublclassing NSThread
- From: "Shawn Erickson" <email@hidden>
- Date: Tue, 16 Dec 2008 11:20:34 -0800
On Tue, Dec 16, 2008 at 10:49 AM, Jean-Daniel Dupas
<email@hidden> wrote:
> No. In Cocoa you never subclass NSThread. Instead of overriding start, you
> implement you own start wherever you want (and with the name you want) and
> you pass it as parameter (SEL + target).
Pre-Leopard that we true, as of Leopard NSThread was enhanced to also
support subclassing (if you find the need to do so).
"Prior to Mac OS X v10.5, the only way to start a new thread is to use
the detachNewThreadSelector:toTarget:withObject: method. In Mac OS X
v10.5 and later, you can create instances of NSThread and start them
at a later time using the start method.
...
In Mac OS X v10.5 and later, you can subclass NSThread and override
the main method to implement your thread's main entry point. If you
override main, you do not need to invoke the inherited behavior by
calling super."
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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