Re: Manual KVO and will/didChangeValueForKey
Re: Manual KVO and will/didChangeValueForKey
- Subject: Re: Manual KVO and will/didChangeValueForKey
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 2 Jun 2005 23:51:21 -0700
On Jun 2, 2005, at 11:27 PM, Andrew White wrote:
I'm basically wanting to define a property on B that says 'B
objectInKeyAtIndex: X' returns whatever 'A objectInKeyAtIndex: X'
would return, with the caveat that A.key is either static or
updated as a complete entity. The A objectInKeyAtIndex values are
created on demand based on a block of raw data (from an incoming
data packet), which is why I'm leery of creating a regular 'A
setKey' accessor, since that's not really what's happening.
If you want to simulate an array relationship, you should use the
array notifications:
- (void)willChange:(NSKeyValueChange)change valuesAtIndexes:
(NSIndexSet *)indexes forKey:(NSString *)key
- (void)didChange:(NSKeyValueChange)change valuesAtIndexes:
(NSIndexSet *)indexes forKey:(NSString *)key
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Protocols/NSKeyValueObserving.html>
although it's not clear from the description above that any change
notification is necessary on a per-item basis (if it's simply the
case that you want to read values and "pretend" that they don't
change?)?
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