I've seen people do something like [NSString stringWithString:@"some string"]
. Why not just do @"some string"
?
For an example, look at the facebook-ios-sdk
.
+[NSString stringWithString:] -- what's the point? is a similar question, but none of the answers address [NSString stringWithString:@"some string"]
vs. @"some string"
.
[NSString stringWithString:@"some string"]
copies@"some string"
from read-only memory, which is baked in the executable, but as NSString is immutable anyways, I don't see the point either. – Drinkwater