I m New to iphone. 在我的小应用中,如何从照片图书馆获得图像。 我使用以下代码来拍摄图像并贴上图像。
-(IBAction) selectimage
{
UIImagePickerController *picker=[[UIImagePickerController alloc] init];
picker.delegate=self;
picker.sourceType=UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated:YES];
[picker release];
}
-(void) imagePickerController:(UIImagePickerController *)UIPicker didFinishPickingMediaWithInfo:(NSDictionary *) info
{
[UIPicker dismissModalViewControllerAnimated:YES];
imageview.image=[info objectForKey:"UIImagePickerControllerOriginalImage"];
NSLog("Image Path=%@",imageview.image);
}
Its succefully placed to Imageview. But i cant get its imagepath. I m using nslog("%@",imageview.image); it shows "Image Path=" in console. How can i get its path and how to retrieve photos from photo library. Any body help me. Thanks in advance.