1

Hi so I'm trying to read and write from a .txt file named "highscore.txt", I'm going to be reading it when I print a label's text (example: highscore.text = "(highscoreTextFromHighScoreFile)") and I'll be writing in it when xyz happens. And is there anyway to read a Specific Line of the Text? Like the first line has 1 value thats readable and the third line has another line readable and writeable?

(I'm trying not to use NSUserDefaults if you try recommending it to me.)

Thank you for taking your time to help.

Peter Larson
  • 143
  • 4
  • 1
    What have you tried? Have you checked out http://stackoverflow.com/questions/24097826/read-and-write-data-from-text-file – Grimxn Nov 23 '15 at 22:01
  • I would recommend you to use StreamReader class for reading text files. It will make everything easy and clean. (http://stackoverflow.com/a/24648951/4078517) – Darvas Nov 24 '15 at 06:53
  • is there any reason why you want txt? Writng to a plist is a lot easier to both organize your data and easier to write/read from a file. (you can set up your data with an NSDictionary or NSArray and write to a file with 1 function call from within the object) – Knight0fDragon Nov 24 '15 at 15:19

0 Answers0