0
所以我一直在更新Swift 3.0的代碼,當應用程序打開時,我與iCloud同步並執行獲取請求。意外地發現零,同時展開核心數據的可選值
但是我得到的可選錯誤以下
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.syncWithCompletion { (completed) -> Void in
}
其中在的appDelegate
func syncWithCompletion(_ completion:@escaping (_ completed:Bool) -> Void) {
if !ensemble.isLeeched {
ensemble.leechPersistentStore { error in
if error != nil {
print("cannot leech \(error!.localizedDescription)")
completion(false)
}
else {
print("leached!!")
completion(true)
}
}
}
else {
ensemble.merge{ error in
if error != nil {
print("cannot merge \(error!.localizedDescription)")
completion(false)
}
else {
print("merged!!")
completion(true)
//NSNotificationCenter.defaultCenter().postNotificationName("Updated-DB", object: nil)
}
}
}
}
執行以下功能我不知道該選什麼錯誤的,Xcode的更新功能遷移時的標題。
UPDATE:
因此很明顯,下面有一個零值
但我不能確定是什麼原因造成這一點,因爲雨燕3遷移
把所有勞累斷點放在xCode中,並告訴我們請你在哪裏是你的錯誤。 –
@PavelGatilov我已經更新了這個問題,並且我正要仔細檢查在遷移 –
時還發生了什麼變化,但是在哪裏崩潰? –