Note that there are some explanatory texts on larger screens.

plurals
  1. POInconsistent crash while posting to facebook using FBNativeDialogs on iOS6.0
    primarykey
    data
    text
    <p>I've been struggling with this issue for a while now and I just can't seem to reproduce it accurately enough to describe the exact use-case. Essentially, what I'm doing is issuing a request for opening a native iOS 6.0 Facebook share dialog (using the Facebook iOS SDK 3.1.1):</p> <pre><code>if ([[SocialManager sharedManager] isNativeFacebookShareDialogAvailable]) { if (!url) { url = [NSURL URLWithString:@""]; } if (!imageUrl) { imageUrl = [NSURL URLWithString:@""]; } dispatch_async(backgroundQueue, ^{ NSData *imageData = [NSData dataWithContentsOfURL:imageUrl]; UIImage *image = [UIImage imageWithData:imageData]; if (!image) { image = [[UIImage alloc] init]; } if ([FBNativeDialogs canPresentShareDialogWithSession:[FBSession activeSession]]) { dispatch_async(dispatch_get_main_queue(), ^{ [FBNativeDialogs presentShareDialogModallyFrom:sender initialText:initialText images:@[image] urls:@[url] handler:^(FBNativeDialogResult result, NSError *error) { if (error) { failBlock([[error userInfo] description]); } else { if (result == FBNativeDialogResultSucceeded) { completionBlock(); } else if (result == FBNativeDialogResultCancelled) { failBlock(@"User cancelled"); } else if (result == FBNativeDialogResultError) { failBlock(@"Unknown error"); } } }]; }); } else { LogErr(@"Can't display native share dialog for active session"); } }); } </code></pre> <p>Right after <code>presentShareDialogModallyFrom:sender</code> is called, I either get the following crash log:</p> <pre><code>*** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection &lt;__NSArrayM: 0x1d161490&gt; was mutated while being enumerated.' *** First throw call stack: (0x32ede2a3 0x326b097f 0x32eddd85 0x35da094d 0x32edb62f 0x35da07f5 0x35e7e5e5 0x35e0ccd7 0x35e0cb6d 0x372c490f 0x35e0ca61 0x35e160d5 0x372b783b 0x35e160b1 0x372b711f 0x372b699b 0x372b6895 0x372c5215 0x372c53b9 0x36f5fa11 0x36f5f8a4) libc++abi.dylib: terminate called throwing an exception </code></pre> <p><strong>OR</strong> I get no crash and the native share dialog appears as it should.</p> <p>The stack implies a call on a thread called <code>UIRemoteViewControllerCreationRequest</code> at this point, here are 2 examples for <strong>two different crashes</strong>: <img src="https://i.stack.imgur.com/3Y4Ne.png" alt="enter image description here"> <img src="https://i.stack.imgur.com/Jrew6.png" alt="enter image description here"></p> <p>Thanks for your help</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.
 

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