Hello,
In my app, I have a UIImagePickerController. When a image is selected, my view controller needs to get the image and pass it to another view controller, which is pushed onto self.navigationController. But I am always getting SEGFAULTS or nil arguments, and things like that. I would appreciate it if you could tell me what is wrong with this code:
FirstViewController.m:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
self.currentpicture = [img copy];
[self dismissModalViewControllerAnimated:YES];
[self goNext];
}
-(void)goNext{
SecondViewController *vc = [[SecondViewController alloc] initWithNibName:@"Second" bundle:nil];
[vc giveMePicture:currentpicture];
[self.navigationController pushViewController:vc animated:YES];
}
SecondViewController.m:
-(void)giveMePicture:(UIImage *)data {
self.currentpicture=[data copy];
}
They both have currentpicture defined as a UIImage *currentpicture;
I now should have currentpicture as some data, but it crashes every time! I have tried many different things and I cannot figure this out.
I am really inexperienced at this Objective-C - so sorry if this is really obvious.
Isaac Waller