In essence, here is my code in a subclass of NSTextFieldCell:
- (void)setStringValue:(NSString *)aString {
[super setStringValue:aString];
[self doSomething];
}
- (void)doSomething {
NSLog(@"%@", [self stringValue]);
}
In essence, I'm trying to get my subclass notified of a change in the string value, and when the value changes, I want the subclass of NSCell to be able to do something with that new value (Using -attributedStringValue would be even better, because I want to cache it for special drawing). The problem is, for some reason, calling -(NSString *)stringValue somehow results in a call to -(void)setStringValue which ends up becoming...
...an infinite loop. Can someone enlighten me on this - and a possible workaround?