Xcode 6.1 appDelegate.swift在'lazy var managedObjectContext:NSManagedObjectContext?'上崩溃了

时间:2014-10-26 14:14:23

标签: ios iphone xcode swift

当我在Xcode 6时我没有问题,但现在我已经下载了6.1版本,我的应用程序崩溃了。我调试了我的应用程序,发现问题出在这里:

lazy var managedObjectContext: NSManagedObjectContext? = {
    // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) This property is optional since there are legitimate error conditions that could cause the creation of the context to fail.
    let coordinator = self.persistentStoreCoordinator
    if coordinator == nil {
        return nil
    }
    var managedObjectContext = NSManagedObjectContext()
    managedObjectContext.persistentStoreCoordinator = coordinator
    return managedObjectContext
}()

当我的应用程序输入此部分代码时,xcode说:

dyld`dyld_fatal_error:
0x2be220c4:  trap   //There is a breakpoint here
0x2be220c8:  nop

有谁知道如何解决这个问题?

0 个答案:

没有答案