我必须修复swift2的下列代码。在Swift 2中的错误处理
if !UIImagePNGRepresentation(img).writeToFile(imagePath, options: nil, error: &error) {
if let actualError = error {
NSLog("Image not saved. \(actualError)")
}
}
要编译它,我有if row: Cannot invoke writeToFile
这个错误类型(String, options: _, error: inout NSError?)
如何解决它的参数列表。
对于将来的问题,尽量使标题尽可能与问题相关。大多数用户没有时间点击一个模糊的问题并解决一个模糊的问题。这会导致你的问题没有收到很多的流量,你没有得到你的答案。 – Arc676