I had a problem getting observeValueForKeyPath to be called but solved it using this:
observeValueForKeyPath not being called
However, I'd like to know how to handle this in general for future reference.
The code that works looks like this:
- (void) input: (NSString*) digit
{
NSLog(@"input() - Entering... digit=%@", digit);
if ([digits length] < MAX_DIGITS_LENGTH)
{
self.digits = [[[ self.digits autorelease] stringByAppendingString:digit] retain];
NSLog(@"digits is now %@", digits);
}
}
Prior to this I was using an NSMutableString instead of NSString and just said used appendString. I didn't do an assignment and I wasn't appending "self" to the digits variable. Are there any good websites/tutorials that explain this more in depth so I know how to do this in general for any type of object?