Я пытаюсь сделать снимок с помощью камеры, но после захвата изображения или отмены imagePickerView мое приложение будет зависать без какого-либо сообщения об ошибке, ошибки BAD_ACCESS или сбоя! просто заморозить !!!! вот мой код:
-(IBAction)takePic {
if ([UIImagePickerController isSourceTypeAvailable:CAMERASUPPROT]) {
USImage.hidden = YES;
ipc = [[UIImagePickerController alloc]init];
ipc.delegate = self;
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.cameraOverlayView = maskImage;
ipc.delegate = self;
[self.view addSubview:MaskArea];
[self presentModalViewController:ipc animated:YES];
TAKENPHOTO.image = nil;
[ipc release];
} else {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" message:@"Your Device Doesn't Support Camera" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
TAKENPHOTO.image = [info objectForKey:UIImagePickerControllerOriginalImage];
[picker dismissModalViewControllerAnimated:YES];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker {
[picker dismissModalViewControllerAnimated:YES];
}