EXC_BAD_ACCESS → ZombieObject 설정
EditSchme > 해당스킴 > Diagnostics > Memory Management
Enable Zombie Objects
EXC_BAD_ACCESS → ZombieObject 설정
EditSchme > 해당스킴 > Diagnostics > Memory Management
Enable Zombie Objects
.h
<UINavigationControllerDelegate, UIImagePickerControllerDelegate>
////////////
.m
- (IBAction)tapBtn:(id)sender {
UIImagePickerController *pickerLibrary = [[UIImagePickerController alloc] init];
pickerLibrary.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[pickerLibrary setAllowsEditing:YES];
pickerLibrary.delegate = self;
//[self presentModalViewController:pickerLibrary animated:YES];
//deprecated in iOS6
[self presentViewController:pickerLibrary animated:YES completion:nil];
}
- (void) imagePickerController:(UIImagePickerController * )picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{
targetImage = image;
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void) imagePickerControllerDidCancel:(UIImagePickerController *)picker{
[self dismissViewControllerAnimated:YES completion:nil];
}
UITapGestureRecognizer *pressGesture =
[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(doSomethingMethod)];
[targetView addGestureRecognizer:pressGesture];