stringWithFormat or initWithFormat ?

Joined
Oct 7, 2009
Messages
14
Reaction score
0
Points
1
Location
Singapore
Code:
NSMutableString* variable = [NSMutableString stringWithFormat:@"%d %d %d",1,2,3];
Code:
NSMutableString* variable = [ [NSMutableString alloc] initWithFormat:@"%d %d %d",1,2,3];

Is there any advantage the second example have over the first accept for the fact that you'll have to release it manually later ?
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top