• 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: Jerry Krinock <email@hidden>
  • Date: Tue, 23 Feb 2010 21:24:42 -0800

On 2010 Feb 23, at 14:52, Kyle Sluder wrote:

> On Tue, Feb 23, 2010 at 2:32 PM, Jerry Krinock <email@hidden> wrote:
>> Furthermore, I've never been able to find any documentation stating that Cocoa is required to invoke the set mutator method(s).  Invoking the setEmployees: method, which both Ken and I have noted *does* happen, is a KVC-compliant technique.  So, I'm not sure that it's a bug.
>
> Not quite. KVC compliance refers to implementing the proper methods
> such that -setValue:forKey:, -valueForKey: and
> -mutable(Set|Array)ValueForKey: work. It doesn't refer to how one
> modifies that property. So it doesn't make sense to say that "calling
> -setEmployees: is KVC-compliant."

Well, I said a KVC-compliant technique.  Let's say "making the change in a KVC-compliant way".  But, yes, it's moot...

> In fact, according to the Accessor
> Search Implementation Details, you don't need to implement -set<Key>:
> at all. It just so happens that Core Data gives you an implementation
> that doesn't do what you need to do, and KVC uses it when convenient.
> The real bug is that NSArrayController doesn't use the fast-path KVC
> methods for updating the target of its contentSet binding, which is
> what exposes the need to override -set<Key>: in this situation.

OK, I see it now.  It's in the Key-Value Coding Programming Guide > Accessor
Search Implementation Details > Accessor Search Pattern for Unordered Collections.  The array controller is skipping Step 1 in the search path.  So, I agree it's definitely a bug, either behavior or documentation.


_______________________________________________

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

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: mmalc Crawford <email@hidden>)
 >Re: Core Data: Custom to-many relationship setter not being invoked (From: Jerry Krinock <email@hidden>)
 >Re: Core Data: Custom to-many relationship setter not being invoked (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Deprecated APIs
  • Next by Date: Re: Removing quit button from dock menu
  • Previous by thread: Re: Core Data: Custom to-many relationship setter not being invoked
  • Next by thread: High Level Toolkit -- is it obsolete or not?
  • Index(es):
    • Date
    • Thread