Possible Duplicate:
Should I prefer to use literal syntax or constructors for creating dictionaries and arrays?
Is there any difference between:
NSArray *array = @[@"foo", @"bar"];
and
NSArray *array = [NSArray arrayWithObjects:@"foo", @"bar", nil];
Is one of those more stable, faster, or anything else?
This documentation doesn't mention anything about efficiency directly, but does mention that
is equivalent to
I would have to assume that at an assembly level, the two are identical.
Thus the only difference is preference. I prefer the former, it's faster to type and more direct to understand.