• 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: +(NSSet *)keyPathsForValuesAffectingValueForKey:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: +(NSSet *)keyPathsForValuesAffectingValueForKey:


  • Subject: Re: +(NSSet *)keyPathsForValuesAffectingValueForKey:
  • From: "Ashley Clark" <email@hidden>
  • Date: Tue, 14 Oct 2008 00:04:00 -0500 (CDT)
  • Importance: Normal

> Does anyone know if you can use this mechanism for dotted values, or does
> it have to be a value local to the object?
>
> For example, could you say that field "a" depends on "b.c"? I'm trying to
> do that but it doesn't seem to work or me.

Yes, you can. I'm doing it in at least one of my classes like so:

+ (NSSet *)keyPathsForValuesAffectingActualUnitPrice {
    return [NSSet setWithObjects:@"unitPrice", @"transaction.unitPrice",
nil];
}

And the transaction property itself also has a dependency:

+ (NSSet *)keyPathsForValuesAffectingTransaction {
    return [NSSet setWithObject:@"transactions"];
}

It all works perfectly here. What errors (if any) are you seeing? Make
sure that all of your data access to those dependent properties are
enclosed in willChange.../didChange... methods.

--
Ashley Clark

_______________________________________________

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:
    • tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
      • From: Chris Idou <email@hidden>
References: 
 >+(NSSet *)keyPathsForValuesAffectingValueForKey: (From: Chris Idou <email@hidden>)

  • Prev by Date: How to trace a GC error?
  • Next by Date: Re: How to trace a GC error?
  • Previous by thread: +(NSSet *)keyPathsForValuesAffectingValueForKey:
  • Next by thread: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
  • Index(es):
    • Date
    • Thread