1
我不知道這是用戶錯誤還是由於Xcode和Swift更新。我拉着圖像文件從解析,並不管我怎麼調整的語法,我得到了一個持久的錯誤:無法解析的錯誤與解析「獲取數據的背景塊」
迅速:64:23:無法調用「getDataInBackgroundWithBlock」與類型的 參數列表「( (?!NSData的NSError) - >無效)
我的代碼是:
func callData() {
var imageQuery = PFObject(className: "QuestionMaster")
let iconImageFile = imageQuery["questionImage"] as! PFFile!
iconImageFile.getDataInBackgroundWithBlock {
(imageData: NSData!, error: NSError?) -> Void in
if (error == nil) {
self.icon1 = UIImage(data: imageData[0])
self.icon2 = UIImage(data: imageData[1])
self.icon3 = UIImage(data: imageData[2])
self.icon4 = UIImage(data: imageData[3])
self.icon5 = UIImage(data: imageData[4])
self.icon6 = UIImage(data: imageData[5])
self.icon7 = UIImage(data: imageData[6])
self.icon8 = UIImage(data: imageData[7])
self.icon9 = UIImage(data: imageData[8])
}
else {
NSLog("Something went wrong.")
}
我已經從剖析文檔直工作。我也曾嘗試:
iconImageFile.getDataInBackgroundWithBlock(imageQuery, block: {
(imageData: NSData!, error: NSError?) -> Void in
而且我交換!
和?
無濟於事。在我的代碼findObjectInBackgroundWithBlock
的其他地方也會發生同樣的情況。
我對我的作品在最新的解析框架版本昨天拉框架,沒有骰子。 –
檢查編輯@spacemonkey – OscarVGG
做到了。非常感謝您的幫助!感謝您抽出寶貴的時間。 –