managedObjectContext in Swift 3

前端 未结 4 971
故里飘歌
故里飘歌 2021-02-19 23:30

I want to work through this example code in which Swift and CoreData is used to create a table. However, using Swift 3 I fail to get it to work. Most importantly, I cannot prope

4条回答
  •  走了就别回头了
    2021-02-20 00:18

    For macOS and Swift 3.1

    let moc: NSManagedObjectContext = (NSApplication.shared().delegate as! AppDelegate).persistentContainer.viewContext
    

提交回复
热议问题