Can't process UIImage from UIImagePickerController and app crashes..

Posted by eimaikala on Stack Overflow See other posts from Stack Overflow or by eimaikala
Published on 2010-05-29T18:14:05Z Indexed on 2010/05/29 18:22 UTC
Read the original article Hit count: 232

Hello guys, I am new to iPhone sdk and can't figure out why my application crashes. In the .h I have: UIImage *myimage; //so as it can be used as global -(IBAction) save; @property (nonatomic, retain) UIImage *myimage;

In the .m I have: @synthesize myimage; - (void)viewDidLoad { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.allowsImageEditing = YES; self.imgPicker.delegate = self; self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

} -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { myimage = [[info objectForKey:UIImagePickerControllerOriginalImage]retain]; [picker dismissModalViewControllerAnimated:YES]; }

-(IBAction) process{ myimage=[self process:myimage var2:Val2 var3:Val3 var4:Val4]; UIImageWriteToSavedPhotosAlbum(myimage, nil, nil, nil); [myimage release]; }

When the button process is clicked, the application crashes and really I have no idea why this happens. When i change it to:

-(IBAction) process{ myimage =[UIImage imageNamed:@"im1.jpg"]; myimage=[self process:myimage var2:Val2 var3:Val3 var4:Val4]; UIImageWriteToSavedPhotosAlbum(myimage, nil, nil, nil); [myimage release]; } the process button works perfectly...

Any help would be appreciated. Thanks in advance

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiimage