is there any way to terminate UIImagePickerViewController while taking video?

Posted by wadelim on Stack Overflow See other posts from Stack Overflow or by wadelim
Published on 2011-01-14T02:22:42Z Indexed on 2011/01/14 4:53 UTC
Read the original article Hit count: 169

Hello!

It's the first time to ask a question! until now, I don't need to ask qestion about my problem
because Here is the rellay good place to share and solve my programming error(problem?)! now, I'm having a big problem at UIImagePickerViewController

Fisrt, while My app is enconding Video Image on pckerViewcontroller, If I push the home button to go background, My app is terminated T_T(EXC_BAD_ACCESS) I want to keep my app alive(living) or close safely pickerview controller to be back I'm going crazy if there is anyone to help me, I would really appreciated Thank you!

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// // in Init Method

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enterBackgound:) name:UIApplicationDidEnterBackgroundNotification object:nil];

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

UIImagePickerController *pickerController = [UIImagePickerController new]; i_pc = pickerController; // "i_pc" is member instance .... [self presentModalViewController:pickerController animated:YES]; [pickerController release];

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

while encoding some video in pckerview Contrller, Push homeButton! and return back

then my app is killed

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// // this is my code to try to solve above problem.. But It's not working

-(void)enterBackground:(NSNotification *)notification{

[self dismissModalViewControllerAnimated:YES];

} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

© Stack Overflow or respective owner

Related posts about iphone

Related posts about xcode