Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an object to the end of an NSMutableArray

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 works fine.

Regards

like image 435
some_id Avatar asked Jun 30 '10 21:06

some_id


1 Answers

[plistArray addObject:title];

See the NSMutableArray Class Reference.

like image 167
kennytm Avatar answered Oct 30 '22 19:10

kennytm