• 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: code example on NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: code example on NSThread


  • Subject: Re: code example on NSThread
  • From: Robert Goldsmith <email@hidden>
  • Date: Mon, 29 Jul 2002 11:21:47 +0100

On Monday, July 29, 2002, at 10:53 am, Chong Hiu Pun wrote:

> May you some me some example on how to use NSThread?Thanks!

Look at the docs for [NSThread
detachNewThreadSelector:toTarget:withObject:]

[NSThread detachNewThreadSelector:@selector(method:)
toTarget:target withObject:object] basically means 'start a new
thread by running method 'method:' from target instance 'target'
passing parameter 'object'.

'method:' is run and can do what it wants. If it terminates, the
thread closes. Just remember that, like any process, you need to
create an autorelease pool at the start of the method (and
remember to release it before the thread closes, just to be
tidy!).

Robert

---
GnuPG public key:
http://www.Far-Blue.co.uk/RSGoldsmith.asc

[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig; charset=US-ASCII]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >code example on NSThread (From: "Chong Hiu Pun" <email@hidden>)

  • Prev by Date: Re: More memory allocation questions
  • Next by Date: GraphPaper troubles
  • Previous by thread: code example on NSThread
  • Next by thread: Re: code example on NSThread
  • Index(es):
    • Date
    • Thread