Reputation: 630
I am looking to create a text file on my iPhone programmatically and also write some data onto the file. How can I read the text file manually?
Upvotes: 2
Views: 2228
Reputation: 14662
Use NSString
's initWithContentsOfFile:encoding:error:
to read the file, then use stringByAppendingFormat:
to add some data, and then use writeToFile:atomically:encoding:error:
to write it on disk.
Upvotes: 2