• 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:29:07 -0800

On Tue, Dec 16, 2008 at 9:29 AM, Brad O'Hearne
<email@hidden> wrote:
> Hello,
>
> I am trying to create an NSThread subclass which completely wraps the
> desired behavior of the thread execution.

I am sorry but what you described isn't making sense to me so I really
don't know how to answer your question. Can you restate it?

> As you can see, the initWithTarget: param is set to self, but the purpose of that statement is to set
> self, and self isn't defined yet to my knowledge

Inside of any instance method "self" exists (hidden parameter to the
method call) and points to the instance that received the message. In
"init" methods you do the self = [super initXxxx]; to deal with the
super implementation possibly swapping the original instance out for
another instance (see Cocoa does on initializers).

If you sub-class NSThread you override -main to provide the
implementation for the code that will run in the thread context. I am
not sure why you want/think you need to override -start.

-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

  • Follow-Ups:
    • Re: Sublclassing NSThread
      • From: "Bradley S. O'Hearne" <email@hidden>
References: 
 >Sublclassing NSThread (From: Brad O'Hearne <email@hidden>)

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