Hi all!
Two issues are showing up now that I want to update my app that previously worked fine in iOS4-. Previous version of app downloaded from app store running on my iOS5.0.1 phone works though and I did not update any of the code around the camera functions.
1. Camera - after user takes a picture, you get the standard "Retake" or "Use" buttons. Retake is fine but "Use" causes the app to freeze and crash.
2. Camera Roll - after user chooses image from camera roll, nothing appears to happen. It actually did select though -- but now you have to click "Cancel" and the image appears in the main window.
In both cases, no error messages in the debugging window so not sure what happened. Code for the two functions in question:
Code:
//Camera Method//////////////////////////
- (IBAction) cameraDeviceAction {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == YES) {
imgPicker = [[UIImagePickerController alloc] init];
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imgPicker.delegate = self;
imgPicker.allowsImageEditing = NO;
if([ApplicationUtils getSystemVersionAsAnInteger] >= __IPHONE_3_1) {
if(cameraOverlayView == nil) {
cameraOverlayView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"photo_guideline_640x960.png"]];
cameraOverlayView.frame = CGRectMake(0, 0, 320, 431);
}
imgPicker.cameraOverlayView = cameraOverlayView;
}
[self presentModalViewController:imgPicker animated:YES];
}
}
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self showBackdropScreen:[info objectForKey:@"UIImagePickerControllerOriginalImage"]];
}
//Photo Library Method //////////////////////////
- (IBAction) libraryAction {
imgPicker = [[UIImagePickerController alloc] init];
imgPicker.allowsImageEditing = NO;
imgPicker.delegate = self;
[self presentModalViewController:imgPicker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
[self showBackdropScreen : img];
}
I think the errors are in this section, but please let me know what you think or if you need more of the file.
Thanks much!