Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerControllerDelegate not responding properly

I'm using the UIImagePickerController in iOS 4.2.1 on an iPhone 3Gs. I've previously used the deprecated method

- (void)imagePickerController: didFinishPickingImage: editingInfo:

without a problem. I have another app using the new didFinishPickingMediaWithInfo API in another app, and the method is never getting called by the picker once media is chosen.

//MyViewController.h
    @interface MyViewController : UIViewController < UIImagePickerControllerDelegate, UINavigationControllerDelegate>

//MyViewController.m

    if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        UIImagePickerController *picker =  [[UIImagePickerController new] autorelease];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        picker.mediaTypes =  [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
        picker.videoQuality = UIImagePickerControllerQualityTypeHigh;
        picker.allowsEditing = NO;
        [self presentModalViewController:picker animated:TRUE];
    }

    - (void)imagePickerController:(UIImagePickerController *)picker imagePickerController:didFinishPickingMediaWithInfo:(NSDictionary *)editingInfo{
        //**NEVER CALLED**
    }
like image 481
akaru Avatar asked Mar 05 '26 14:03

akaru


1 Answers

you have

- (void)imagePickerController:(UIImagePickerController *)picker imagePickerController:didFinishPickingMediaWithInfo:(NSDictionary *)editingInfo

where you probably want

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
like image 146
tmiddlet Avatar answered Mar 07 '26 03:03

tmiddlet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!