Should I return an NSMutableString in a method that returns NSString
- by Casey Marshall
Ok, so I have a method that takes an NSString as input, does an operation on the contents of this string, and returns the processed string. So the declaration is:
- (NSString *) processString: (NSString *) str;
The question: should I just return the NSMutableString instance that I used as my "work" buffer, or should I create a new NSString…