a working colleague and me are struggling to properly answer the exact difference between two different ways of creating an array:
NSArray *array1 = @[@"this is my first entry",@"this is my second entry"];
NSArray *array2 = [[NSArray alloc] initWithObjects:@"first entry",@"second entry",nil];
- Can anyone explain this?
- What is the preferred way of using and why?
- Another interesting question would be: does it work the same for NSString, NSDictionary, etc classes?
Thank you in advance!