If i do this
NsMutableArray* array = [[NSMutableArray alloc]init];
[array addObject:someObject];
someProperty = array;
[array release];
Do i need to add nil to the end of the array, or does the init method do that for me.
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.
No and NSArrays ‘s do not end in a nil.
What does need a nil is initilaising an array with a set of objects using arrayWithObjects: or initWithObjects: Here the nil is required to tell at runtime when the list of objects ends as happens with any C variable arguments function e.g. using va_args