Objective-C "miscasting" a string/int using stringWithFormat and %d
- by user141146
Hi, I think this is a relatively simple question, but I don't precisely know what's happening.
I have a method that tries to build a string using NSString's stringWithFormat
It looks like this:
NSString *line1 = [NSString stringWithFormat:@"the car is %d miles away", self.ma];
In the above line "self.ma" should be an int, but in my case, I…