Re: Array operators (was: Custom canRemove binding)
Re: Array operators (was: Custom canRemove binding)
- Subject: Re: Array operators (was: Custom canRemove binding)
- From: Scott Anguish <email@hidden>
- Date: Wed, 5 May 2004 21:21:42 -0400
On May 5, 2004, at 7:56 PM, Allan Odgaard wrote:
On 5. May 2004, at 21:56, Scott Anguish wrote:
[...] bind enabled2 to theArrayController.content.count
Which should probably be: theArrayController.arrangedObjects.@count
you're right about the arrangedObjects..
Speaking of which (array operators), are these supposed to be KVO
compliant? cause it would seem that they are not, except when the key
path involves an NSArrayController.
E.g. this works:
[arrayController addObserver:self
forKeyPath:@"arrangedObjects.@count" options:0 context:NULL];
Where this gives a run-time error:
id obj = [arrayController arrangedObjects];
[obj addObserver:self forKeyPath:@"@count" options:0 context:NULL];
Which imply that binding to [File's Owner].someArray.@count will also
fail, unless File's Owner (also?) overload addObserver:... -- I hope
I've overlooked something obvious, cause this does not make a lot of
sense to me... ;)
@count isn't a legitimate keypath I don't think.
What of Foundation and AppKit are KVO compliant is something that
should be documented.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.