I have two entities and two NSMangedObject subclasses. One entity, which we'll call Alice, has a to-many relationship with the other entity - which we'll call Bob. When an Alice object is created, it needs to have an associated Bob object so that my other code works.
Here's the code from my Alice subclass's awakeFromInsert method:
Here's the code from my Alice subclass's awakeFromInsert method:
Code:
-(void)awakeFromInsert
{
[super awakeFromInsert];
Bob *bob = [[Bob alloc] initWithEntity:[self entity] insertIntoManagedObjectContext:[self managedObjectContext]];
[self addPlacesObject:bob];
}