How to add an object to the end of NSMutableArray

I have the following code

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

but I would like to add an object to the end of the array.

How can this be done, and I need to set the last value to nil, at the moment I do not, and it works fine.

Hi

+3
source share
1 answer
[plistArray addObject:title];

See the reference to the NSMutableArray class .

+21
source

Source: https://habr.com/ru/post/1752539/


All Articles