Re: code example on NSThread
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.