• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Addressing Relationships in awakeFromInsert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Addressing Relationships in awakeFromInsert


  • Subject: Addressing Relationships in awakeFromInsert
  • From: August Trometer <email@hidden>
  • Date: Wed, 10 Aug 2005 15:01:26 -0500

I've got 2 Entities set up in a master-detail configuration. They have inverse Relationships.

I've subclassed the Detail Entity and overridden the awakeFromInsert method to add some default values (date added, etc.). However, when I try to address the owner or Master via valueForKeyPath, I get a Null return.

Here's a snippet from the Detail Entity:

- (void) awakeFromInsert
{
    [super awakeFromInsert];

[self setValue:[NSDate date] forKey:@"dateCreated"]; // works fine
[self setValue:[self valueForKeyPath:@"master.createdBy"] forKey:@"createdBy"]; // sets the value to NULL
}



I'm sure I'm missing something here -- it does seem to be the best place for this sort of default setting -- but I can't seem to figure out how to address the Master object. I've also tried simply NSLogging [self valueForKeyPath:@"master"] and it, too, returns Null.


Any pointers would be appreciated.

Thanks!

August





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Addressing Relationships in awakeFromInsert
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Why Won't CFPreferencesCopy[App]Value Read Alias?
  • Next by Date: Re: Addressing Relationships in awakeFromInsert
  • Previous by thread: Re: Problem centering inside a scrollview
  • Next by thread: Re: Addressing Relationships in awakeFromInsert
  • Index(es):
    • Date
    • Thread