7
Sadece Swift 3 benim xcode8 güncellenmiş ve bu hatayı aldım
:Değer 'uyumsuz' hayır üyesi var - Swift 3
DispatchQueue.main.asynchronously(execute:
: Bu satırda
Value of type 'DispatchQueue' has no member 'asynchronously'
İşte tüm parçacık İşte:
DispatchQueue.main.asynchronously(execute: {
//Display alert message with confirmation
let myAlert = UIAlertController(title: "Alert", message:messageToDisplay, preferredStyle: UIAlertControllerStyle.Alert);
let okAction = UIAlertAction(title:"OK", style:UIAlertActionStyle.Default){
action in self.dismissViewControllerAnimated(true, completion:nil);
}
myAlert.addAction(okAction)
self.presentViewController(myAlert, animated:true, completion:nil);
});
}
}
catch let error as NSError {
print(error.localizedDescription)
}
}
task.resume()
}
}
son Swift 3'e güncelleme bana hataların çok vermiştir, bunlar otomatik sabit ama Bu kendi başına düzeltmeyecek ve ne yapacağımı bilmiyorum.
kullanım DispatchQueue.main.async (...) – AleyRobotics
@Yuri ne demek istiyorsun? Zaten böyle kodlanmış değil mi? –
"Eşzamansız" adı, yöntem için eski bir adaydı ve "async" olarak yeniden adlandırıldı. – OOPer