I'm fairly new to Objective-C and I'm trying to get a button pressed event to trigger on a button that is on a custom view that is being overlaid on a UIImagePicker. I connect the button to an IBAction on the overlaid view, but when I press the button I get a bad access error.
here is the code I am using to for the overlay:
// prepare imagePicker view
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
imagePicker.allowsEditing = NO;
imagePicker.showsCameraControls = NO;
// create view for overlay
CGRect overlayRect = CGRectMake(0, 0, imagePicker.view.frame.size.width, imagePicker.view.frame.size.height);
UIView *overlayView = [[UIView alloc] initWithFrame:overlayRect];
// prepare custom view
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
@"Main" bundle:[NSBundle mainBundle]];
UIViewController *overlay = [storyboard instantiateViewControllerWithIdentifier:@"overlayView"];
imagePicker.cameraOverlayView = overlay.view;
// display imagePicker
[self.navigationController presentViewController:imagePicker animated:YES completion:nil];