Lets say I have a controller class A which implements UIImagePickerControllerDelegate.
within A , I implement the delegate like this :
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo
{
[self dismissModalViewControllerAnimated:YES];
}
Who will get dismissed here ? the imagePickerController or A ? please explain why…
Calling
presentModalViewController:animated:on aUIViewControllerwill display a view controller modally. By analogy,dismissModalViewControllerAnimated:dismisses the modal view controller. In this case, it would dismiss the image picker controller (Assuming the image picker controller is the modal view of the object that is its delegate, which is most likely the case).