stringWithFormat vs. initWithFormat on NSString

Viewed 18766

I am wondering what differences such as disadvantages and/or advantages there are to declaring an NSString this way:

NSString *noInit = [NSString stringWithFormat:@"lolcatz %d", i];

as opposed to:

NSString *withInit = [[NSString alloc] initWithFormat:@"Hai %d", i];

What was the motivation of putting stringWithFormat instead of just having the initWithFormat way of initializing the string?

2 Answers
Related