Suppi
Suppi

Reputation: 630

Create and read a text file

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

Answers (1)

gcamp
gcamp

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

Related Questions