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