tags:

views:

663

answers:

2

Hi , i am using the Picker controller with UIImagePickerControllerSourceTypePhotoLibrary.

in the delegate didFinishPickingImage is called , but when i click on cancel button it doesnt enter

  • (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker

, though the controller is dismissed .

A: 

Make sure the class you think it is calling implements the proper delegate protocol.

This case should be UIImagePickerControllerDelegate, like this:

@interface YourClassViewController : UIViewController < UIImagePickerControllerDelegate>

Good luck!

Genericrich
Hii , it does implement the UIImagePickerControllerDelegate , since - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { NSLog(@" HomeMainViewController size %d :", image.size.width) ;}is been called.
Vijayeta
A: 

You need to implement the rest of UIImagePickerControllerDelegate. When the cancel button is clicked, the picker will call -imagePickerControllerDidCancel: on its delegate.

Tom Harrington