• 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: Setting up multiple Dependent Keys
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting up multiple Dependent Keys


  • Subject: Re: Setting up multiple Dependent Keys
  • From: Scott Little <email@hidden>
  • Date: Fri, 19 Nov 2004 11:26:59 +0100

Hi,

Slightly related question to this one. Does anyone know if I can use key paths in this method? I.e.:

+ (void)initialize
{
[Controller setKeys:
[NSArray arrayWithObjects:@"object.subObject.trueKey", @"extendedCost", nil]
triggerChangeNotificationsForDependentKey:@"profit"];
}

Thanks,
Scott

--
It is when I struggle to be brief that I become obscure.
- Quintus Horatius Flaccus (Horace)
--
scott little
email@hidden

On 19 Nov, 2004, at 07:48, J. Scott Anderson wrote:

Excellent. Thank you. *Now* I understand.




On Nov 18, 2004, at 11:54 PM, Sherm Pendley wrote:

On Nov 19, 2004, at 12:25 AM, J. Scott Anderson wrote:

+ (void)initialize
{
[Controller setKeys:
[NSArray arrayWithObjects:@"extendedPrice", @"extendedCost", nil]
triggerChangeNotificationsForDependentKey:@"profit"];
}

If I also want to have additional fields (Dependent Keys I would think), then how do I do it. I tried making multiple versions of the above code but with different Dependent Keys and with changes to the Keys. That results in error messages telling me that I have redefined the "initialize" method and that I have duplicate "initialize" methods among other errors.

Huh? Why on Earth would you create additional +initialize methods??? Just add an additional call to +setKeys:arrayWithObjects:triggerChangeNotificationsForDependentKey: to the +initialize method you already have:

+ (void)initialize
{
[Controller setKeys: [NSArray arrayWithObjects: @"extendedPrice", @"extendedCost", nil]
triggerChangeNotificationsForDependentKey: @"profit"];

[Controller setKeys: [NSArray arrayWithObjects: @"foo", @"bar", nil]
triggerChangeNotificationsForDependentKey: @"baz"];
}

sherm--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Setting up multiple Dependent Keys (From: "J. Scott Anderson" <email@hidden>)
 >Re: Setting up multiple Dependent Keys (From: Sherm Pendley <email@hidden>)
 >Re: Setting up multiple Dependent Keys (From: "J. Scott Anderson" <email@hidden>)

  • Prev by Date: Re: -document works inconsistently in NSWindowController subclass
  • Next by Date: Re: Drag and Drop
  • Previous by thread: Re: Setting up multiple Dependent Keys
  • Next by thread: -document works inconsistently in NSWindowController subclass
  • Index(es):
    • Date
    • Thread