• 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
Re: Sublclassing NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Sublclassing NSThread (From: Brad O'Hearne <email@hidden>)
 >Re: Sublclassing NSThread (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: More - Safari Download Security Alerts
  • Next by Date: Re: Text track in QTMovie
  • Previous by thread: Re: Sublclassing NSThread
  • Next by thread: Re: Sublclassing NSThread
  • Index(es):
    • Date
    • Thread