Subclassing NSArrayController; observer messages
Subclassing NSArrayController; observer messages
- Subject: Subclassing NSArrayController; observer messages
- From: Brent Gulanowski <email@hidden>
- Date: Wed, 28 Jul 2004 13:10:14 -0400
I'm trying to create a hybrid solution that uses an NSArrayController
subclass to bind to part of my model, while providing outline view
data source methods to keep the view updated. I have buttons connected
to add: and remove:. I thought it would be simple to -reload: the
outline when -add: and -remove: were called -- by overriding
-observeValueForKeyPath:ofObject:change:context: to pass the message
on to super and then -reload: the outline.
But observeValue... isn't being called. I've even checked the
spelling. Evidence suggests that I'm not triggering observer
notifications, but my model object supports KVC, in the form of
indexed accessor methods. And they are being called whenever a change
is made.
My workaround was to override -add: and -remove:. Easy enough, but it
proves I don't understand something in KVO or bindings. Can anyone
tell me what I'm missing? Specifically, where do I need to override so
that I can tell my outline to reload? And how can I tell if the
observer messages are being sent or not?
Thanks.
--
Brent Gulanowski
http://www.boredastronaut.com
_______________________________________________
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.