HOw to use UIIMagePickerController?
- by aman-gupta
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