如何知道相机完成拍照在ios中

时间:2015-02-16 06:37:27

标签: ios camera uiimagepickercontroller

我使用图像选择器控制器来呈现相机,拍摄完图像后,它进入结束模式,所以我希望代表在相机完成拍摄时调用。 就像通过NSNotificationCenter一样。

       UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate=self;
    picker.allowsEditing = YES;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentViewController:picker animated:YES completion:NULL];

2 个答案:

答案 0 :(得分:1)

试试这个:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:@"_UIImagePickerControllerUserDidCaptureItem" object:nil ];

答案 1 :(得分:0)

在拍照后调用了UIImagePickerController .it的委托方法。

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