Re: Setting up multiple Dependent Keys
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