Re: indexed accessor properties and NSArray/NSMutableArray's
Re: indexed accessor properties and NSArray/NSMutableArray's
- Subject: Re: indexed accessor properties and NSArray/NSMutableArray's
- From: Jeff Johnson <email@hidden>
- Date: Tue, 5 Aug 2008 20:11:25 -0500
On Aug 5, 2008, at 7:27 PM, Roland King wrote:
Thanks. There's always just ONE more piece of documentation to read
isn't there. So here's my (possibly) last question. If you define
neither the accessor methods nor a getter/setter and make
mutableArrayValueByKey use direct access to the variables, will
that generate KVO notifications?
Yes, assuming that there is an observer for the keypath @"myArray".
For example, calling [[myObject mutableArrayValueForKey:@"myArray"]
addObject:@"test"] will trigger -will/
didChange:valueAtIndexes:forKey: notifications. The observer's -
observeValueForKeyPath:ofObject:change:context: method will be called
with change type NSKeyValueChangeInsertion.
-Jeff
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden