Day*_*and 30 crash core-data ios swift xcode6
我有一个使用Core Data的Swift项目,生成的代码saveContext()导致Xcode因SourceKitService Crashed错误而崩溃.当我评论它时,错误停止,似乎self.managedObjectContext是导致错误.我已经注释掉了我的代码,所以它就像一个新项目,但它仍然崩溃.谢谢
(Xcode 6.0.1)
func saveContext () {
if let moc = self.managedObjectContext {
var error: NSError? = nil
if moc.hasChanges && !moc.save(&error) {
// Replace this implementation with code to handle the error appropriately.
// abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
NSLog("Unresolved error \(error), \(error!.userInfo)")
abort()
}
}
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个新项目并复制了我的代码,新项目很好(并且完全一样),所以我向苹果公司报告这是一个潜在的错误.
谢谢
更新:
找到这个让事情变得更容易:)
小智 64
我会处理各种项目并不断得到这个错误,有时候Xcode变得无法使用.我最终通过退出Xcode,清空~/Library/Developer/Xcode/DerivedData文件夹,然后重新打开项目来解决问题.
| 归档时间: |
|
| 查看次数: |
7632 次 |
| 最近记录: |