I came across the following:
NSArray *array = @[object1, object2];
It seems to be creating an NSArray, but is this array instance an autoreleased object, or must I release it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a new collection literal available in the compiler that ship with xcode 4.4 and above
is equivalent to
so yes, it is an autoreleased object, if you need this to be retained, you can do
this question has a good description of all of the new literals