当我执行代码时,出现以下错误。
下面是错误代码。
错误:thread-1-exc-bad-access-code-1-address-0x30000
@interface PhotoEffectsVC : UIViewController
{
void (^controllerImage) (UIImageView *);
}
- (IBAction)saveButtonClicked:(id)sender {
controllerImage(self.imgView);
}
// In the view where i want to access the image
-(void) viewWillAppear:(BOOL)animated
{
UIStoryboard *aUIStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
PhotoEffectsVC *photoEffectVC= [aUIStoryboard instantiateViewControllerWithIdentifier:@"getPhotosVC"];
[photoEffectVC setControllerImage:^(UIImageView *imageName)
{
[self.imgView setImage:imageName.image ];
}];
}