• 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
Re: Core Data: Custom to-many relationship setter not being invoked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: Custom to-many relationship setter not being invoked


  • Subject: Re: Core Data: Custom to-many relationship setter not being invoked
  • From: Ken Tabb <email@hidden>
  • Date: Mon, 22 Feb 2010 23:54:20 +0000

Hi Keary,

thanks for your reply. Yep I implemented all 4, as per the Design -> Data Model -> Copy to clipboard template, i.e.

- (void)addEmployeesObject:(Employee *)value;
- (void)removeEmployeesObject:(Employee *)value;
- (void)addEmployees:(NSSet *)value;
- (void)removeEmployees:(NSSet *)value;

However if I implement -setEmployees as per Jerry's e-mail (and seemingly contravening the advice in the Core Data Programming Guide), then it works like a charm :-/

Thanks for taking the time to help,
Ken

On 22 Feb 2010, at 11:21, Keary Suska wrote:

On Feb 22, 2010, at 3:59 PM, Ken Tabb wrote:

Hi folks,

I'm clearly doing something daft but unable to see the error of my ways.

Distilling my problem down into the Department & Employees example, both are custom NSManagedObject subclasses, each with an inverse to- many / to-one relationship as you'd expect. My problem is that Department's custom -awakeFromInsert gets called, yet its - addEmployeesObject and -addEmployees methods don't ever get called. If I add employees in the app, it all works swimmingly, but my custom accessors aren't ever used.

Do you implement both the add<key> *and* remove<key>? The framework might require both to assume compliance.


HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


- - - - - - - - - - Dr. Ken Tabb Mac & UNIX Developer - Health & Human Sciences Machine Vision & Neural Network researcher - School of Computer Science University of Hertfordshire, UK


_______________________________________________

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


  • Follow-Ups:
    • Re: Core Data: Custom to-many relationship setter not being invoked
      • From: Quincey Morris <email@hidden>
References: 
 >Core Data: Custom to-many relationship setter not being invoked (From: Ken Tabb <email@hidden>)
 >Re: Core Data: Custom to-many relationship setter not being invoked (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Core Data: Custom to-many relationship setter not being invoked
  • Next by Date: Re: lastKeyViewTraversingSubviewsBeginningWithView
  • Previous by thread: Re: Core Data: Custom to-many relationship setter not being invoked
  • Next by thread: Re: Core Data: Custom to-many relationship setter not being invoked
  • Index(es):
    • Date
    • Thread