managedObjectContext in Swift 3

前端 未结 4 970
故里飘歌
故里飘歌 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:15

    I swift 3 you can get managedContext set by this code:

      let managedContext = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
    

提交回复
热议问题