mogenerator

Mogenerator not found by Xcode

怎甘沉沦 提交于 2019-12-05 14:58:41
问题 I'm trying to use Mogenerator in my iOS project developed in Xcode 5. I've installed Mogenerator with brew: brew install mogenerator then link: brew link mogenerator After that I have access to this tool from my command line. Next I'm trying to add one more step (script executing) in build phases (shell /bin/sh): mogenerator --model "${PROJECT_DIR}/MyProject/Model.xcdatamodeld/Model.xcdatamodel" --output-dir "${PROJECT_DIR}/MyProject" --template-var arc=true In effect I get error: line 2:

Integrate mogenerator within Xcode 4

你。 提交于 2019-12-04 07:56:03
In my application I'm using Core Data stuff to enable persistent data saving. Since I've seen that mogenerator provides a good approach to create and maintain NSManagedObject subclasses (also with additional functionalities), I'm looking for some tips for integrating monogenerator within Xcode 4? P.S. The question has been submitted based on share your knowledge, Q&A-style . For Xcode 4.5+, the easiest way is to setup a "Pre-action" in your scheme: Edit the scheme you want to build Open the "Build" item and select "Pre-actions" Click on the "+" and add a "New Run Script Action" In the "Provide

How do I get mogenerator to recognize the proper type for Transformable attributes?

主宰稳场 提交于 2019-12-03 01:15:42
问题 I have a Core Data model with a single transformable attribute. I also have this attribute use a custom NSValueTransformer, setup in the model properly. When I use mogenerator to generate/update my machine and human files, the machine files for the entity containing this attribute always type the attribute to NSObject. In order for Core Data to use my custom value transformer, this type needs to be the type the transformer understands. Right now, I manually do this in the human file by

How do I get mogenerator to recognize the proper type for Transformable attributes?

白昼怎懂夜的黑 提交于 2019-12-02 14:30:15
I have a Core Data model with a single transformable attribute. I also have this attribute use a custom NSValueTransformer, setup in the model properly. When I use mogenerator to generate/update my machine and human files, the machine files for the entity containing this attribute always type the attribute to NSObject. In order for Core Data to use my custom value transformer, this type needs to be the type the transformer understands. Right now, I manually do this in the human file by redefining the property with the proper type. This does the job and gets the transformer working. However, I

awakeFromInsert called twice with nested contexts

人盡茶涼 提交于 2019-12-02 13:07:16
问题 This project uses Mogenerator and Magical Record. I have tracked down a bug to the fact that awakeFromInsert is getting called twice. Once for each of my contexts I presume. This is an issue because I need to listen for NSNotifications on this NSManagedObject like this: - (void)awakeFromInsert { // Listen for a return from background mode [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(enteringForeground:) name:UIApplicationWillEnterForegroundNotification object:nil]

Extending Core Data generated NSManagedObject classes

ε祈祈猫儿з 提交于 2019-11-30 17:23:24
问题 I've been dealing with Core Data for the first time and I wanted to know what the best practices are for extending the classes that Xcode generates for my NSManagedObject entities. I saw mogenerator and I've been also using a similar approach to that as suggested in SUPER HAPPY EASY FETCHING IN CORE DATA. So I had three kinds of classes: The EasyFetching category (only one class); A generated NSManagedObject subclass (i.e.: _Entity); A custom subclass with some custom methods like finding all

How do I use Mogenerator?

我与影子孤独终老i 提交于 2019-11-30 08:13:07
I installed Mogenerator . Now what do I do? How do I use it? The first problem I have is that I have no idea where it was installed to. During the install process, it only let me select the hard drive to install it on, not the directory. The most natural location would be the Applications folder, but it isn't there. Next, the readme (which I found online) states: Xmo'd works by noticing when your *.xcdatamodel is saved. If the model file's Xcode project item comment contains xmod, an AppleScript is fired that creates a folder based on your model's file name and populates it with derived source

How do the Mogenerator parameters work, which can I send via Xcode? [closed]

风流意气都作罢 提交于 2019-11-29 18:35:08
The help for Mogenerator is very minimal. What do all the parameters do? Parameters that work both via the command line utility and Xcode: --base-class : The name af the base class which the "private class" (e.g. _MyObject.h ) will inherit from. This will also add an import in the form of #import "MyManagedObject.h" to the same .h file. Tip: if the class you want to inherit from is located in a library, the default import statement won't work. As a workaround, you could have an extra level of inheritance for each project you create and have that class inherit from the library on (e.g. set the