CoreData - Mogenerator 的使用
来源:互联网 发布:笨太子 知乎 编辑:程序博客网 时间:2024/05/16 10:52
Why use Mogenerator instead of XCode directly:
Mogenerator is a program that builds two custom classes for each entity in a Core Data model: a machine version and a human version.
This command-line tool, given an .xcdatamodel file, will generate two classes per entity. The first class (machine version), _MyEntity, is intended solely for machine consumption and will be continuously overwritten to stay in sync with your data model. The second class (human version), MyEntity, subclasses _MyEntity, won't ever be overwritten and is a great place to put your custom logic.
The machine version handles the basic behavior you need from a custom Core Data class (like Xcode’s generated classes). It is expected that the machine version will get overwritten every time the model changes, so you should not make any changes here(they will be lost).
The human version extends the machine version and is the class you modify for your own app specific behavior.
Steps to generator the Machine Files and Human Files for xcodemodel database.
1. Download Mogenerator from:
https://github.com/rentzsch/mogenerator/
I used latest version v1.26: Thu Apr 12 2012download
2. Install the mogenerator-1.26.dmg from your download folder.
3. Start the console and go the resource folder
4. Run the command below to generator the files:
mogenerator -m RobertLiu.xcdatamodeld/RobertLiu.xcdatamodel -M Model -H Entities
If your application need support ARC, you need to use below command:
mogenerator --template-var arc=true -m RobertLiu.xcdatamodeld/RobertLiu.xcdatamodel -M Model -H Entities
5. You will see the results:
xxx machine files and xxx human files generated.
Notes:
1. Beside the command line, mogenerator supports the xmod, which is integrated with Xcode. here is the reference to setup xmod.
http://raptureinvenice.com/getting-started-with-mogenerator/
2. In case you want to uninstall mogenerator and try the previous version, such asv1.25: Thu Feb 16 2012download, please just remove below files:
• /usr/bin/mogenerator
• /private/var/db/receipts/com.rentzsch.mogenerator.bom
• /private/var/db/receipts/com.rentzsch.mogenerator.plist
- CoreData - Mogenerator 的使用
- 关于CoreData的一个工具Mogenerator的使用
- [ios]关于CoreData的一个工具Mogenerator的使用
- 关于CoreData的一个工具Mogenerator的使用
- Mogenerator的初级使用
- mogenerator and coredata
- CoreData的使用
- CoreData的使用
- CoreData的简单使用
- coredata的使用
- CoreData的使用
- CoreData的基本使用
- CoreData 的是使用
- CoreData+MagicalRecord的使用
- CoreData的基本使用
- CoreData的使用
- CoreData的使用
- CoreData的使用
- 域
- python测试驱动开发
- 程序员究竟该如何提高效率
- 2440 裸机 之lcd驱动 编写出现问题及感悟
- Linux 下 SSH 配合 SecureCRT 的密匙完美使用方法。
- CoreData - Mogenerator 的使用
- win7下 取消自动播放
- sql注入词&语法
- C++ 运算符重载
- mysql事务处理
- 求质数(素数)算法思想
- ssh+jmail实现,注册完发送邮件,点击链接之后完成注册。
- 如何向android的framework里添加新类,新方法
- 整合FLEX+GAE+JAVA+BlazeDS