【发布时间】:2014-11-12 19:43:01
【问题描述】:
我收到以下代码错误。它来自 data.writeToFile。我试过 photoPath、photoPath!、photoPath?,但它总是出错。错误是:getData 调用中的 extraArgument(这不是错误,因为当我注释掉 data.writeToFile 时它工作正常)。
let file = object.objectForKey("image") as PFFile
let photoPath = NSURL.fileURLWithPath(NSTemporaryDirectory())?.URLByAppendingPathComponent("object", isDirectory: true).URLByAppendingPathExtension("jpg")
file.getDataInBackgroundWithBlock({ (data: NSData!, error: NSError!) -> Void in
data.writeToFile(photoPath!, atomically: true)
}, progressBlock: { (progress: Int32) -> Void in
println(progress)
})
【问题讨论】:
标签: swift parse-platform