5

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

1 Answer 1

22
[plistArray addObject:title];

See the NSMutableArray Class Reference.

Sign up to request clarification or add additional context in comments.

2 Comments

+1 for the link to the reference documentation which for some reason is not checked before posting a question on SO
-1 for being a XXX. It would have been just as easy to paste the answer AND the link to the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.