Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
>> I would not make that assumption. Who says +[NSArray array] constructs >> anything at all? Try comparing the return values of two calls to >> [NSArray array] sometime. ;-) >> >> I happen think +new is more readable, but it’s really just a matter of >> preferen

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
s [[Foo alloc] init] under the hood, which is the same thing +new does, so +new is of course not necessary in Swift and is not imported (just like +[NSArray array]). >> So for the foreseeable future, the >> difference is that +array returns an autoreleased object, meaning that in

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Kyle Sluder
code. > So for the foreseeable future, the > difference is that +array returns an autoreleased object, meaning that in > ARC code, +new is the better choice. I would not make that assumption. Who says +[NSArray array] constructs anything at all? Try c

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
> On Aug 19, 2016, at 3:46 PM, Quincey Morris > wrote: > > On Aug 19, 2016, at 10:53 , Charles Srstka > wrote: >> >> [NSArray array] is a synonym for [[[NSArray alloc] init] autorelease]. > >

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Carl Hoefs
> On Aug 19, 2016, at 1:46 PM, Quincey Morris > wrote: > > My point is that Apple might revisit the implementation of NSArray at any > time (in these Swiftian days, stranger things have happened), and choose to > write it with full ARC compatibility,

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Quincey Morris
On Aug 19, 2016, at 12:33 , dangerwillrobinsondan...@gmail.com wrote: > >> AFAICT, the main reason *not* to use ‘new’ is to avoid generating anxiety >> for those who come back to read the code later, and who might worry that the >> inconsistency means something. > > Even though new has been a

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread dangerwillrobinsondanger
> On Aug 20, 2016, at 2:50 AM, Quincey Morris > wrote: > > AFAICT, the main reason *not* to use ‘new’ is to avoid generating anxiety for > those who come back to read the code later, and who might worry that the > inconsistency means something. Even

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Kirk
array = [NSArray new] and array = [NSArray array] -- Should be interchangeable under ARC. Kirk Kerekes (iPhone) > On Aug 19, 2016, at 12:22 PM, cocoa-dev-requ...@lists.apple.com wrote: > > array = [NSArray new] or array = [NSAr

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Alex Zavatone
so this is a resend. Sorry >> if it gets to some of you twice. >> >> >> >> Yes, I know about literals, but I have a different question here. >> >> >> Is this safe? >> >> I have seen this in some code in our codebase: >> array = [NSArray new];

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Gary L. Wade
t; > I have seen this in some code in our codebase: > array = [NSArray new]; > > I'm familiar with using the public method from the NSArray header and what > the docs say to use: > or array = [NSArray array]; > > Is there any risk to using [NSArray new] to init

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread David Duncan
gt; Yes, I know about literals, but I have a different question here. > > > Is this safe? > > I have seen this in some code in our codebase: > array = [NSArray new]; > > I'm familiar with using the public method from the NSArray header and what > the docs say to

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Charles Srstka
t; > Is this safe? > > I have seen this in some code in our codebase: > array = [NSArray new]; > > I'm familiar with using the public method from the NSArray header and what > the docs say to use: > or array = [NSArray array]; > > Is there any risk to using [NSAr

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Quincey Morris
On Aug 16, 2016, at 02:20 , Alex Zavatone <z...@mac.com> wrote: > > Is there any risk to using [NSArray new] to init an array instead of [NSArray > array]?? The only real difference between the two is the ownership semantics of the returned object. For ‘new’ it’s +1 and for

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Ryan Dignard
eaten, so this is a resend. Sorry > if it gets to some of you twice. > > > > Yes, I know about literals, but I have a different question here. > > > Is this safe? > > I have seen this in some code in our codebase: > array = [NSArray new]; > > I'm familiar with

Re: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Doug Hill
s, I know about literals, but I have a different question here. > > I have seen this in some code in our codebase: > array = [NSArray new]; > > I'm familiar with using the public method from the NSArray header and what > the docs say to use: > or array = [NSArray array]; >

Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Alex Zavatone
I sent this out this morning but it got eaten, so this is a resend. Sorry if it gets to some of you twice. Yes, I know about literals, but I have a different question here. Is this safe? I have seen this in some code in our codebase: array = [NSArray new]; I'm familiar with using

array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Alex Zavatone
Yes, I know about literals, but I have a different question here. I have seen this in some code in our codebase: array = [NSArray new]; I'm familiar with using the public method from the NSArray header and what the docs say to use: or array = [NSArray array]; Is there any risk to using