FROM : Shawn Erickson
DATE : Mon Nov 19 22:58:42 2007
On Nov 19, 2007 1:42 PM, Frank Reiff <<email_removed>> wrote:
> Now for the question: can I call it with waitUntilDone: NO !?
Yes, assuming no other inter-thread dependencies exist.
> The code as it stands wouldn't be thread safe because the NSString
> parameter might already have been de-allocated by the worker thread by
> the time [text copy] is executed on the main thread.
The performSelectorOnMainThread:withObject: method retains the object
you supply until the target object has processed the selector.
-Shawn
DATE : Mon Nov 19 22:58:42 2007
On Nov 19, 2007 1:42 PM, Frank Reiff <<email_removed>> wrote:
> Now for the question: can I call it with waitUntilDone: NO !?
Yes, assuming no other inter-thread dependencies exist.
> The code as it stands wouldn't be thread safe because the NSString
> parameter might already have been de-allocated by the worker thread by
> the time [text copy] is executed on the main thread.
The performSelectorOnMainThread:withObject: method retains the object
you supply until the target object has processed the selector.
-Shawn
| Related mails | Author | Date |
|---|---|---|
| Frank Reiff | Nov 19, 22:42 | |
| Mike Abdullah | Nov 19, 22:52 | |
| Shawn Erickson | Nov 19, 22:58 |






Cocoa mail archive

