I have this situation:
I have two CoreData entities:
MUSIC_ACTIVITY is an ABSTRACT CoreData entity;
LOCATION: with some attributes as: city, address,...
BAR: with some attributes; PUB: with some attributes;
in MUSIC_ACTIVITY I have a relationship with LOCATION (1to1).
MUSIC_ACTIVITY is the PARENT entity of BAR; MUSIC_ACTIVITY is the PARENT entity of PUB;
I generate automatically class of this model.. So: In MUSIC_ACTIVITY I have one property LOCATION In LOCATION I have property MUSIC_ACTIVITY (inverse)
How can I access to LOCATION information into BAR and PUB entity ?
for example: I declarated the relationship with LOCATION using 'address' (like name). So in MUSIC_ACTIVITY I have a property address (LOCATION type). In PUB I need to overwrite the init..for example:
-(id) initWithEntity:(NSEntityDescription *)entity insertIntoManagedObjectContext:(NSManagedObjectContext *)context
{
self = [super initWithEntity:entity insertIntoManagedObjectContext:context];
if (self) {
self.name = @"MY NAME";
self.address = .... ///ERROR ////
}
return self;
}
but I can't use self.address ...