HOw to use UIIMagePickerController?

Posted by aman-gupta on Stack Overflow See other posts from Stack Overflow or by aman-gupta
Published on 2010-04-11T14:53:49Z Indexed on 2010/04/12 6:33 UTC
Read the original article Hit count: 350

Filed under:

Hey, IN my application I m using this code on button click for getting image from PhotoLibrary:-

-(IBAction) getPhoto:(id) sender {

UIImagePickerController *picker = [[UIImagePickerController alloc]init];
picker.delegate = self; picker.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
[picker release];


//picker = nil;

}

-(void)imagePickerController:(UIImagePickerController *) picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

[picker dismissModalViewControllerAnimated:YES];

}

But problem is that when i run my application in mobile it will get terminated on button click.Where I m wrong it works properly on iphone simulator but termninating on iphone Device

Please reply me its urgent

Thanks in Advance

© Stack Overflow or respective owner

Related posts about iphone