On May 19, 2009, at 7:52 PM, Kiel Gillard wrote:
I have a few scalar (NSUInteger, CGRect etc) ivars in my model objects. I have declared identically named properties for these scalars and instructed the compiler to synthesize accessor methods for them. My controller objects add themselves to the model objects as observers with the keypaths to the scalars.

Sounds right, should work.

However, I'm not getting any key-value observing notifications when changes to those observed properties occur (observeKeyPath... isn't being called at all).

I feel I may be missing something very simple but I have no idea what. Any suggestions?

Use NSLog and/or the debugger to question everything. You say the controllers are adding themselves as observers; are they doing so as self, or is there a variable that you think is pointing to a controller, but might be nil? You say changes to the properties are occurring and you're not setting the ivars directly; how *are* you setting the property? If it's through code, are you positive the object you're modifying is == to the object you observed? How are you confirming that the property is actually getting changed?

--Andy

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to