• 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: Sherm Pendley <email@hidden>
  • Date: Fri, 19 Nov 2004 00:54:40 -0500

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

  • Follow-Ups:
    • Re: Setting up multiple Dependent Keys
      • From: "J. Scott Anderson" <email@hidden>
References: 
 >Setting up multiple Dependent Keys (From: "J. Scott Anderson" <email@hidden>)

  • Prev by Date: Re: Setting up multiple Dependent Keys
  • Next by Date: Re: NSNetService address resolution crash
  • Previous by thread: Re: Setting up multiple Dependent Keys
  • Next by thread: Re: Setting up multiple Dependent Keys
  • Index(es):
    • Date
    • Thread