Re: [Pyobjc-dev] Controller Layer
Brought to you by:
ronaldoussoren
From: b.bum <bb...@ma...> - 2003-12-02 03:26:42
|
On Dec 1, 2003, at 4:48 PM, Carlos Phillips wrote: >> Try adding... >> >> def automaticallyNotifiesObserversForKey_(self, aKey): >> return NO >> >> ... to your class and see if that fixes the problem. Also, make sure >> you are running pyobjc based on the latest source from CVS -- there >> have been many updates that are 10.3 specific. >> >> Finally, we should continue this on pyobjc-dev. I'm really busy @ >> Apple and will likely not have time to answer you in the coming days >> -- but the folks on pyobjc-dev will answer and they are really >> friendly/knowledgeable. > > Overloading the method did in fact fix the problem. I thought this > might be useful to someone else. This appears to be because of the method swizzling that occurs because of key-value observing [KVO]. It causes an infinite loop in the bridge. You can still use KVO, though. You just need to call... - (void)willChangeValueForKey:(NSString *)key; - (void)didChangeValueForKey:(NSString *)key; ... or ... - (void)willChange:(NSKeyValueChange)change valuesAtIndexes:(NSIndexSet *)indexes forKey:(NSString *)key; - (void)didChange:(NSKeyValueChange)change valuesAtIndexes:(NSIndexSet *)indexes forKey:(NSString *)key; ... before/after the value is changed. b.bum |