Without Arc, this:

NSString *s = [ [ NSString alloc ] initWithFormat: ...];
[ someCollection addObject: s ];
[ s release ];

is clearly more efficient (because not using autoreleasepools) than:

NSString *s = [ NSString stringWithFormat: ...];
[ someCollection addObject: s ];

But what about Arc? 
Is the compiler clever enough to make both versions equally efficient?
Or should one still avoid using the convenience method stringWithFormat: ?


Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to