KVO: programmatically created custom views not getting initial value notifications
KVO: programmatically created custom views not getting initial value notifications
- Subject: KVO: programmatically created custom views not getting initial value notifications
- From: George Orthwein <email@hidden>
- Date: Fri, 19 May 2006 17:00:29 -0400
I'm having a strange problem that seems like it would be in the list
archives, but I'm not finding anything.
My app has one or more custom views that observe an NSArrayController
(which is bound to a MOC):
[docPrefsController addObserver:self
forKeyPath:@"selection.headerColor" options:nil context:NULL];
The initial custom view is contained in the nib. On startup, it gets
notified of the dozen or so attributes I'm observing using code
similar to the above line. That's good. It redraws itself appropriately.
I then programmatically create other custom views of the same class
(not via a nib). I can see that they are correctly registering
addObserver:... upon creation, but they do NOT get notified of the
current values upon registering. They do get notified of subsequent
value changes.
I've verified that the controller (core data) values are initialized
by the time my initial "nib" custom view registers for KVO, so I'm
having trouble seeing how the situation is different between the
initial view and the later created views.
Any ideas why there is no notification of the initial values? I can't
quite tell for sure from the docs if current values are supposed to
be sent upon registering, but I assume so.
Thanks,
George
_______________________________________________
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