Adding to a NSString
How can I create 开发者_如何转开发a string that can have integers added and removed to it with a simple + or -1?
You can't. What you can do is add or subtract from a number and get the string representation when you need it:
int a = 30;
a++;
a--; // etc.
NSString *numberString = [NSString stringWithFormat:@"%d", a];
If you want to append or remove characters representing integers from the end of strings, look into the NSString class.
If you're looking for operator overloading, Objective C doesn't have it.
精彩评论