我有一张个人资料照片,我正从我的画廊中选择一张照片。我想上传要解析的网址。我做得对吗?我的网址总是为零。
var fileurl = PFFile(data: UIImageJPEGRepresentation(pickedImage, 1.0)!)
print(NSURL(string: (fileurl?.url)!))
答案 0 :(得分:0)
你走了。如果您从手机获取图像并希望其存储位置,则这是位置。
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage?, editingInfo: [NSObject : AnyObject]!) {
if let imageURL = editingInfo[UIImagePickerControllerReferenceURL] as? NSURL {
//imageURL if the full path
let imageName = imageURL.lastPathComponent!
//imageName is the name and extension of the file
}
dismissViewControllerAnimated(true, completion: nil)
}