如何将库中的选定图像存储到NSString

时间:2010-02-24 06:44:52

标签: iphone cocoa-touch uikit

我想从iphone中的照片库中获取所选图像的完整网址到NSString。

是否可能

我的代码是

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

    filePath = /* Here i ant to get the complete url of selected image*/

请帮忙

1 个答案:

答案 0 :(得分:1)

因此,您希望将图像从UIImagePickerController发送到ftp服务器。在您的委托方法中,选择UIImagePickerControllerOriginalImage,即UIImage个对象,然后调用UIImageJPEGRepresentation()创建JPEG文件。然后,您可以将JPEG文件发送到您的ftp服务器。