• 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: keyPathsForValuesAffectingValueFor<key>: not updating immediately
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately


  • Subject: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 27 Oct 2009 12:22:18 -0400

On Oct 26, 2009, at 10:03 PM, Brad Gibbs wrote:

I did read the documentation, which is why I used +keyPathsForValuesAffectingFullAddress. I also tried +keyPathsForValuesAffectingValueForFullAddress:

Both methods work, but only after changing the view and then coming back to it.

Read it again. More carefully. I'll do the same.[1] ;-)

You've gotten several very important things wrong. I just saw Jim's response, so I'll reiterate his point then the other issues:

1 - You did not pay close attention to the method signature as noted in the API reference. As Jim indicated, it's a class method, not an instance method (+ vs. -).

2 - +keyPathsForValuesAffectingValueForFullAddress: is completely wrong. You appear to be bastardizing the + keyPathsForValuesAffectingValueForKey: method. This is a separate method which I encourage you to read about.

3 - The correct signature is the first one you used. It's meant to be read in the docs as "+keyPathsForValuesAffecting<InsertYourKeyInAKVC- CompliantWayHere>". You then changed it (see #1) and made it wrong as well.

4 - If it only works when "changing the view" (I assume you mean some action that causes it to redraw), then it doesn't work. Right? The whole purpose of the collective Cocoa Bindings mechanism is to avoid this very issue, so clearly your approach is not working.


[1] I now realize I myself was not reading or responding carefully when looking for that phrase yesterday evening. +keyPathsForValuesAffectingValueForKey: is the method that cannot be overridden in a category; +keyPathsForValuesAffecting<key> is fine in categories.



-- I.S.


_______________________________________________

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: 
 >keyPathsForValuesAffectingValueFor<key>: not updating immediately (From: Brad Gibbs <email@hidden>)
 >Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately (From: "I. Savant" <email@hidden>)
 >Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately (From: Brad Gibbs <email@hidden>)

  • Prev by Date: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • Next by Date: Re: programmatically determining whether a system would run a GC only app
  • Previous by thread: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • Next by thread: first responder being clobbered
  • Index(es):
    • Date
    • Thread