Why does this syntax work
NSString* newDisplayText = [currentDisplayText stringByAppendingString:digit];
while this one, (assigning the digit NSStrin to the new string first, and then sending it a message using the stringByAppendingString method). Does not work?
NSString* newDisplayText = digit;
[newDisplayText stringByAppendingString:currentDisplayText];
does sending it this method override it´s previous value I set?
I’m having a really hard time figuring out exactly what you’re asking, but here’s a try:
The method
-stringByAppendingString:does not modify its receiver. It constructs a newNSString*object and returns that. So sayingdoes absolutely nothing, since you’re throwing away the newly-created string.