Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem UIImagePickerControllerDelegate, didFinishPickingMediaWithInfo not called
    primarykey
    data
    text
    <p>Hey guys, I know it has been asked more often, but the answers to their questions don't seem to apply here. </p> <p>My didFinishPickingMediaWithInfo method doesn't get called :(</p> <p>Here is my code:</p> <p>The .h-file:</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface DevicePictureController : UIViewController &lt;UINavigationControllerDelegate, UIImagePickerControllerDelegate&gt; { UIImageView *photo; UIButton *selectPhoto; UIButton *takePhoto; NSMutableDictionary *listLocations; NSMutableDictionary *listDevices; UIImagePickerController *picker; } @property (nonatomic, retain) IBOutlet UIImageView *photo; @property (nonatomic, retain) IBOutlet UIButton *selectPhoto; @property (nonatomic, retain) IBOutlet UIButton *takePhoto; @property (nonatomic, retain) UIImagePickerController *picker; -(IBAction)selectPicture:(id)sender; @end </code></pre> <p>The .m-file: #import "DevicePictureController.h"</p> <pre><code>@implementation DevicePictureController @synthesize photo, selectPhoto, takePhoto, picker; - (void)viewDidLoad { [super viewDidLoad]; listLocations = [[NSMutableDictionary alloc] init]; listDevices = [[NSMutableDictionary alloc] init]; picker = [[UIImagePickerController alloc] init]; } -(IBAction)selectPicture:(id)sender { picker.delegate = self; picker.allowsEditing = YES; if ((UIButton *)sender == selectPhoto) { picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } else { picker.sourceType = UIImagePickerControllerSourceTypeCamera; } [self presentModalViewController:picker animated:YES]; } -(void)imagePickController:(UIImagePickerController *)picked didFinishPickingMediaWithInfo:(NSDictionary *)info { [picked dismissModalViewControllerAnimated:YES]; NSLog(@"Geselecteerd: %@", [info objectForKey:UIImagePickerControllerEditedImage]); //photo = [[UIImageView alloc] init]; [photo setImage:[info objectForKey:UIImagePickerControllerEditedImage]]; } @end </code></pre> <p>So, my album or my camera gets loaded/activated properly, but when I click 'Use' or the photo, I only see the 2 buttons and an emtpy UIImageView after the view is dismissed. 'photo' is connected to UIImageView, 'selectPhoto' and 'takePhoto' are connected to their buttons, 'selectPicture' is connected to both the buttons' Touch Up Inside-action. Can anybody help me out?</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.
    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