Re: KVO one-step listening but two-step notifying?
Re: KVO one-step listening but two-step notifying?
- Subject: Re: KVO one-step listening but two-step notifying?
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 23 Dec 2005 01:34:57 -0800
On Dec 22, 2005, at 6:23 PM, Hamish Allan wrote:
- (id)mergedArray
{
return [[_object1 individualArray] arrayByAddingObjectsFromArray:
[_object2 individualArray]];
}
You can observe changes to each of those individualArrays, but by
the time observeValueForKeyPath:... is called it's too late to call
willChangeValueForKey:@"mergedArray" because -mergedArray will
already be providing the new contents.
Store mergedArray as an instance variable. My guess would be that
this will be more efficient anyway...?
BTW: Is merged array intended to be the "sum" of the two arrays, such
that an object can appear more than once in the array?
mmalc
_______________________________________________
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