Hi,
I'm a complete novice, so I'm probably missing something really easy, but I can't get my string appending to work. I add the 3rd character to typedDigit & it crashes - the method is called fine and typedDigit will get to 2 characters long. I think everything is declared properly in the header file. Code is -
-(IBAction)digitPressed:(UIButton *)sender {
NSString *digit = [[sender titleLabel] text]; // in this case, "0" - "9"
if (userIsInMiddleOfTyping) { // typedDigit is already at least 1 character long
typedDigit = [typedDigit stringByAppendingString:digit];
} else { // first character of typedDigit
typedDigit = digit;
userIsInMiddleOfTyping = YES;
}
}
Many thanks for any help!