Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy won't dismissmodalviewcontrolleranimated dismiss UIImagePickerController immediately on ios5?
    primarykey
    data
    text
    <p>I have a UITableViewController that pops up a UIImagePickerController, user takes a pic, hits the Use button, Picker dismisses to show a custom thumbnail spinner while the image is being processed, then the spinner is replaced by the actual thumbnail at the end of processing.</p> <p>At least that's how it worked in iOS4. Now with iOS5 it just sits there processing until it's finished, and then everything works correctly. But I want that spinner in there so the user knows something's happening, otherwise it looks like it just hung.</p> <p>So I have this:</p> <pre><code>- (void) actionSheet: (UIActionSheet *)actionSheet didDismissWithButtonIndex (NSInteger)buttonIndex { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = NO; // yada, yada, yada [self presentModalViewController:picker animated:YES]; [picker release]; } </code></pre> <p>And then this gets called when the user picks "Use":</p> <pre><code>- (void) imagePickerController: (UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self dismissModalViewControllerAnimated:YES]; [self performSelectorOnMainThread:@selector(processImage:) withObject:info waitUntilDone:NO]; animate = true; } </code></pre> <p>And then this gets called to perform the processing while the thumbnail is spinning:</p> <pre><code>- (void) processImage:(NSDictionary *)info { UIImage *image = nil; NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType]; // processing of image animate = false; [activityImageView stopAnimating]; [activityImageView release]; [self.tableView reloadData]; } </code></pre> <p>Like I said, it worked perfectly with iOS4, but with iOS5, no such luck. So what's the deal? The image picker gets dismissed eventually, so why doesn't it get dismissed immediately?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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