简体   繁体   中英

Delegate method occasionally not called

Everything works fine with my custom UIImagePickerController , except for a random case every 4 or 5 times when the following delegate method is not called:

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

It only happens with video recording. I'm able to stop the video capture, but then the delegate method is not called on a rather random basis.

What could I be missing? Would the fact that the UIImagePickerController class is dismissed ( dismissModalViewController ) have anything to do with it not being called? Running out of ideas...

Turns out that dismissing the UIImagePickerController right after [camera stopVideoCapture] was the problem. If I wait to dismiss it once the delegate method was called, then no problem occurs. Note that this is only an issue when doing video.

您的委托对象正在解雇选择器对象,对吧?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM