I have an array like this: CGPoint array[1000] (I add location of touches into this array). The problem is that I want to save this array into a text file in the document directory and also retrieve it. Can anyone help with this?
Thanks All
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.
Instead of using a plain C array, I would recommend that you use an
NSArrayto store your collection of CGPoints. SinceNSArrayconforms to theNSCodingprotocol, you can serialize and deserialize it from a file.You should read up on Archives and Serializations Programming Guide.
EDIT Here’s an example: