> On Aug 7, 2017, at 5:23 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:
> 
> Is the use of +new discouraged also?

No, I use it all the time. It’s simply shorthand for [[XXX alloc] init].

These days with ARC, I tend to use +new instead of factory class methods — e.g. 
[NSMutableArray new] instead of [NSMutableArray array] — on the assumption that 
this avoids adding the new object to the autorelease pool. However, it’s 
possible the compiler & runtime are smart enough to optimize the autorelease 
out of the second call. (Greg?)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to