开发者

Initiliazing NSMutableArray

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 met开发者_运维问答hod do that for me.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜