MR_SHORTHAND does not work

好久不见. 提交于 2019-12-05 11:28:13

I know we haven't announced it publicly prior to this answer, but we've decided to deprecate shorthand support, and remove it in the upcoming MR3 release.

Shorthand support is an interesting idea and feature, but it is not something we want to maintain. We would rather focus our efforts on getting the data centric part of MagicalRecord to be as solid and reusable as possible.

That said, you're certainly welcome to fix it yourself and submit a patch to the older branch of MagicalRecord. Some things to look at are:

  • Make sure the shorthand selectors are included, and add new ones if they are not present
  • Make sure you've used the MagicalRecord class once prior to this call. All the shorthand support is initialized in the class initializer method.
  • If you're using Cocoapods, you may need to update your pod spec reference to 'MagicalRecord/Shorthand'

According to the official guide https://github.com/magicalpanda/MagicalRecord/blob/master/Docs/Installing-MagicalRecord.md

You have to call

[MagicalRecord enableShorthandMethods];

the above error means the core data stack is not initialized yet. you should add [MagicalRecord setupCoreDataStackWithStoreNamed:dbName]; in app delegate before [self.window makeKeyAndVisible];

because if you have called [Team createEntity]; in your root VC [self.window makeKeyAndVisible]; make the view be loaded and visible, but still app has not reached the next line to setup core data stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!