I have a NSMutableArray which is loaded from a txt file. There are 5 strings in the file. If I call removeAllObjects will it remove all strings in the file?
I suspect it does not, so how to remove all strings in the file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your file will remain untouched by anything you do to the
NSMutableArrayinstance you derive from it.As to the how to remove the string, it depends on whether you want to remove just a portion of the file or delete the file. In the case of the latter, the
NSFileManagermethod:will do what you want.
On the other hand, if you need more precise control of the file contents, you may need to drop down to C for that,
fopen, etc.