Note that there are some explanatory texts on larger screens.

plurals
  1. POUITabbarController app: UIImagePickerController image is not shown
    text
    copied!<p>I need some help.</p> <p>I have an app that is based on UITabBarController. It has 4 tabs. In the fourth tab, the user can select a picture from the library, or on iphone, take a picture. When an image is selected (or a photo is taken), after the picker is dismissed, the image is not shown. I am wrecking my head over it...help is much appreciated.</p> <p>Here's the relevant code from the fourth view controller.</p> <p>imageViewController.h:</p> <pre><code>@interface ImagesViewController : UIViewController &lt;UINavigationControllerDelegate, UIImagePickerControllerDelegate&gt; { IBOutlet UIImageView *ivImage; } @property (nonatomic, retain) IBOutlet UIImageView *myImage; - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo; - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker; @end </code></pre> <p>imageViewController.m:</p> <pre><code>@synthesize myImage = ivImage; -(void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo:(NSDictionary *) imageInfo { [picker dismissModalViewControllerAnimated:YES]; [picker release]; picker = nil; UIImage *image = [imageInfo objectForKey:UIImagePickerControllerOriginalImage]; [[self myImage] image]; } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { [picker.parentViewController dismissModalViewControllerAnimated:YES]; [picker release]; picker = nil; } - (void)pickPicture { UIImagePickerController *picker = nil; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { picker = [[UIImagePickerController alloc] init]; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [picker setShowsCameraControls:YES]; picker.delegate = self; picker.allowsEditing = NO; self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:picker animated:YES]; } } </code></pre>
 

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