Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A couple possibilities here.</p> <p>1)</p> <p>How about [NSObject performSelectorOnMainThread: ...] ?</p> <p>E.G.</p> <pre><code>-(void) doNotification: (id) thingToPassAlong { [[NSNotificationCenter defaultCenter] postNotificationName:kImageSavedSuccessfully object:thingToPassAlong]; } -(void)saveImageToFile { NSString *imagePath = [self photoFilePath]; // execute save to disk as a background thread dispatch_queue_t myQueue = dispatch_queue_create("com.wilddogapps.myqueue", 0); dispatch_async(myQueue, ^{ BOOL jpgData = [UIImageJPEGRepresentation([[self captureManager] stillImage], 0.5) writeToFile:imagePath atomically:YES]; dispatch_async(dispatch_get_main_queue(), ^{ if (jpgData) { [self performSelectorOnMainThread: @selector(doNotification:) withObject: self waitUntilDone: YES]; } }); }); } </code></pre> <p>More details at <a href="http://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/performSelectorOnMainThread:withObject:waitUntilDone" rel="nofollow noreferrer">http://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/performSelectorOnMainThread:withObject:waitUntilDone</a>:</p> <p>or 2)</p> <p>Completion Callbacks</p> <p>as seen at <a href="https://stackoverflow.com/questions/3379008/how-can-i-be-notified-when-a-dispatch-async-task-is-complete">How can I be notified when a dispatch_async task is complete?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload