RubenVot
RubenVot

Reputation: 186

New objects on mogenerator

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.

Upvotes: 0

Views: 239

Answers (1)

Sherman Lo
Sherman Lo

Reputation: 2759

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.

Upvotes: 3

Related Questions