【发布时间】:2016-04-18 02:04:36
【问题描述】:
我正在尝试使用 CoreData,但每当我尝试存储对象时,我都会收到 EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) 错误。什么可能导致此错误?附带说明一下,我最初创建项目时并没有打算使用 CoreData,所以 CoreData 是我后来添加到我的项目中的(我不知道这是否是导致问题的原因)。
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
let modelURL = NSBundle.mainBundle().URLForResource("repliaoutput", withExtension: "momd")!
return NSManagedObjectModel(contentsOfURL: modelURL)! //this line is where the EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) error is
}()
【问题讨论】:
标签: ios swift core-data exc-bad-instruction