On Tue, Oct 27, 2009 at 11:39 AM, Brad Gibbs <bradgi...@mac.com> wrote:

> 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...

We are at the point where we can't offer useful advice without seeing
your code. Since +keyPathsForValuesAffecting<Key> is not fundamentally
broken, the most likely cause is a problem with your code.

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

This is wrong for 2 reasons.

Reason #1 - see below.

Reason #2 - you should be passing the literal key paths which affect
the value, not self.streetAddress which is the current value of that
key path.

> I've also tried:
>
> - (NSSet *)keyPathsForValuesAffectingValueForFullAddress {
>        return [NSSet setWithObjects:@"streetAddress", @"city", @"state",
> @"zipCode", nil];
> }

+keyPathsForValuesAffecting<Key> should be implemented as a class
method. (That's what the + prefix means.) You've implemented it as an
instance method. Change it to a class method and you should find that
it works correctly.

(If you set a breakpoint on your code as written, you'll find that it
is never called, which should be a warning sign to you that something
is wrong.)

- Jim
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to