• 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: Brad Gibbs <email@hidden>
  • Date: Tue, 27 Oct 2009 08:39:02 -0700

I don't think there's anything wrong with the method -- I've used it successfully in other apps and have seen it work in Apple sample apps, it just isn't working in this particular case. I'm sure that there's something wrong on my end. Just looking for a little help in figuring out what that could be...

In IB, I have the text fields bound to the model as follows:

self.mSelectedProjectSite.address.streetAddress

In the Address category, I have:

- (NSString *)fullAddress {
return [NSString stringWithFormat:@"%@, %@, %@ %@", self.streetAddress, self.city, self.state, self.zipCode];
}


- (NSSet *)keyPathsForValuesAffectingValueForFullAddress {
return [NSSet setWithObjects:self.streetAddress, self.city, self.state, self.zipCode, nil];
}


I've also tried:

- (NSSet *)keyPathsForValuesAffectingValueForFullAddress {
return [NSSet setWithObjects:@"streetAddress", @"city", @"state", @"zipCode", nil];
}



On Oct 26, 2009, at 7:43 PM, Jim Correia wrote:

On Mon, Oct 26, 2009 at 10:03 PM, Brad Gibbs <email@hidden> 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.

+keyPathsForValuesAffecting<Key> is not fundamentally broken - I use it on my NSManagedObject subclasses as needs dictate.

At this point, I think we need more information to help. At the very
least, let's see your implementation of +
keyPathsForValuesAffectingFullAddress.

- Jim

_______________________________________________

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: keyPathsForValuesAffectingValueFor<key>: not updating immediately
      • From: Jim Correia <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>)
 >Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Alternative to stringWithContentsOfURL
  • Next by Date: Re: Alternative to stringWithContentsOfURL
  • Previous by thread: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • Next by thread: Re: keyPathsForValuesAffectingValueFor<key>: not updating immediately
  • Index(es):
    • Date
    • Thread