New objects on mogenerator

252 Views Asked by At

Im new using Mogenerator (it looks great!). I just can't figure out how is the equivalent sentence to: NSManagedObject *mo = [NSEntityDescription ...]

How should I create new objects in Mogen?

Thanks in advance.

1

There are 1 best solutions below

1
On BEST ANSWER

The usual NSManagedObject *mo = [NSEntityDescription ...] method will still work, otherwise mogenerator provides a + (id)insertInManagedObjectContext:(NSManagedObjectContext *)context; method which you'd call like:

NSMangedObject *mo = [MyModel insertInManagedObjectContext:moc];

To see any other methods mogenerator creates you can take a look at the _MyModel.h files it generates.