Re: Confusion about KVC and custom setter

2012-04-09 Thread Aaron Tuller
you need to override automaticallyNotifiesObserversForKey: to return NO for @"selectedIndex" see: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/KeyValueObserving/Articles/KVOCompliance.html if you observe an object, the runtime automatically generates the willChange/d

Confusion about KVC and custom setter

2012-04-09 Thread Rick Mann
I'm observing a property of one of my classes, "selectedIndex". Even if the value is set to the same value, KVO fires and my observe method gets called, which is something I thought by default it doesn't do. So I implemented a custom setter for my property, like this: - (void) setSelectedIndex: