如果选择电影,则委托事件didFinishPickingMediaWithInfo未被调用?

时间:2011-10-19 19:21:37

标签: iphone objective-c ios4 uiimagepickercontroller

我想使用UIImagePickerController。如果我从PhotoLibrary中选择一张图片,一切正常,调用方法didFinishPickingMediaWithInfo。但如果我选择一部电影,电影就会打开。如果我选择“选择”按钮,则该方法未被调用。谁能帮我?我使用Xcode 4.0.2和iOS 4.3.2

谢谢

1 个答案:

答案 0 :(得分:0)

- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
    if([[info objectForKey:@"UIImagePickerControllerMediaType"] isEqualToString:@"public.movie"]){
        //something code
        [self dismissModalViewControllerAnimated:YES];
    }
}