我这引发这个问题是因为我创建完context后没有和store进行绑定,导致当前的context中的store是nil,然后由context中的store再去搜索实体当然就异常啦。
添加
_context.persistentStoreCoordinator = store;
就ok了
扫描二维码关注公众号,回复:
5428999 查看本文章
我这引发这个问题是因为我创建完context后没有和store进行绑定,导致当前的context中的store是nil,然后由context中的store再去搜索实体当然就异常啦。
添加
_context.persistentStoreCoordinator = store;
就ok了