0
试图从解析中获取图像并设置它的uiimage,但不断收到此错误。运行Xcode中7,快捷的2.0Swift从Parse.com中获取图像并使用它设置图像
不能援引 'getDataInBackgroundWithBlock' 类型的参数列表 '(为imageData:NSData的,错误:NSError.Type,() - >())'
let query: PFQuery = PFQuery(className: "Items")
query.whereKey("ItemOwner", equalTo: "Shreddish")
// 3
query.findObjectsInBackgroundWithBlock { (objects, error) -> Void in
if error == nil {
print("Successfully retrieved: \(objects)")
for object in objects! {
print(object)
let imageFile: PFFile = object["ItemMainImage"] as! PFFile
var image = imageFile.getData()
imageFile.getDataInBackgroundWithBlock(imageData: NSData, error: NSError) {
}
}
} else {
print("Error: \(error) \(error!.userInfo)")
}
}
什么'findObjectsInBackgroundWithBlock'的签名? – NobodyNada
@NobodyNada听起来像一个函数,需要一个闭包 –
是啊我试着跟着一些其他的示例代码,但它没有工作,@ NobodyNada只是想通了,我匹配findObjectsInBackground的签名,它的工作 – shreddish