Relationships during awakeFromInsert
Relationships during awakeFromInsert
- Subject: Relationships during awakeFromInsert
- From: Mike Rossetti <email@hidden>
- Date: Fri, 1 Feb 2008 22:20:26 -0700
In my Core Data Document based application, I need to initialize some
attributes in instances one class (MOB) using attributes from another
class (MOA, which is the root object of the document) to which the
first is related. Here is what the classes each look like:
MOA
_____
aTitle - string
seed - double
myMOBs - one-to-many relationship to MOB
MOB
_____
bTitle - string
seeded - double
myMOA - many-to-one relationship to MOA
In MOB's awakeFromInsert I have the following:
- (void)awakeFromInsert
{
[super awakeFromInsert];
MOA* anMOA = self.myMOA;
self.seeded = anMOA.seed;
}
What I'm seeing is that self.myMOA is 'nil' in this awakeFromInsert,
so apparently the relationship has not yet been established. I've
tried intercepting setValue:forKey: and setPrimitiveValue:forKey: but
they don't appear to be called during creation of an MOB.
Where can I set MOB's 'seeded' using MOA's 'seed'?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden