Core Data singleton manager?

前端 未结 3 762
我在风中等你
我在风中等你 2021-02-01 06:39

What technical reasons are there not to make a singleton class to manage my Core Data? I\'m trying to make a decision now, if I should strip out all of the boilerplate core data

3条回答
  •  耶瑟儿~
    2021-02-01 07:16

    Best practice is to pass the managed object context between view controllers. Apple documentation and samples do that. You should never really have to access your app delegate, not for Core Data, not for anything.

    http://www.cimgf.com/2011/01/07/passing-around-a-nsmanagedobjectcontext-on-the-iphone/

提交回复
热议问题