开发者

How to add an object to the end of an NSMutableArray

开发者 https://www.devze.com 2023-01-05 03:03 出处:网络
I have the following code NSMutableArray *plistArray = [[NSMutableArray alloc] initWithContentsOfFile:filepath];

I have the following code

NSMutableArray *plistArray = [[NSMutableArray alloc] initWithContentsOfFile:filepath];
[plistArray insertObject:title atIndex:2];

but would like to rather add the object to the end of the array.

How can this be done, and do I need to set the last value to nil, at the moment I dont and it wo开发者_开发技巧rks fine.

Regards


[plistArray addObject:title];

See the NSMutableArray Class Reference.

0

精彩评论

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