Returning value from detached NSThread selector with multiple arguments.
Returning value from detached NSThread selector with multiple arguments.
- Subject: Returning value from detached NSThread selector with multiple arguments.
- From: "John Cassington" <email@hidden>
- Date: Thu, 8 Jan 2009 12:13:01 +1100
Hi,
I have a class (JCDataCollector) which I use to collect a large amount
of data from the users machine. JCDataCollector has a
publicly-accessible method named
"collectData:usingFile:shouldLogOutput:". This method is very
resource-intensive, and I would like to move it onto its own thread.
So far, I have been able to call the method using NSThread's
"detachNewThreadSelector:toTarget:withObject:" functionality.
However, I cannot find a way to return the data collected in my
"collectData:usingFile:shouldLogOutput:" method to the object which
originally detached the thread selector.
Also, my "collectData:usingFile:shouldLogOutput:" method takes
multiple arguments, but NSThread's
"detachNewThreadSelector:toTarget:withObject:" only allows one
parameter to be passed. Short of storing all the parameters in an
NSArray, is there any way to pass multiple parameters while calling
"detachNewThreadSelector:toTarget:withObject:"?
Thanks very much,
John Cassington
_______________________________________________
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