Adding text to .Txt File

Discussion in 'iOS Programming' started by iLoveDeveloping, Feb 24, 2010.

  1. iLoveDeveloping macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #1
    Hey,

    I have an app that saves text to a file within the Application, but it saves it from the same page it is on, how would i save text from another screen to the same file?

    Say i have 4 views, and on each view there is some text, i want to add a button to each view that will save that text on that view to a file that the user can look at on the first page when they close and relaunch the app.

    How would i start to go about doing this?
     
  2. skunkworker macrumors regular

    Joined:
    Sep 9, 2007
    #2
    To save to a .txt file all you do is write out the NSData to the file using NSUTF8StringEncoding. If you are saying that you have 4 different views, all of which have text and you want to save all of them. Just grab the contents from the data structure and write them out and read them in, in an orderly manner.
     
  3. iLoveDeveloping thread starter macrumors regular

    Joined:
    Sep 24, 2009
    Location:
    Ireland
    #3
    Thanks, i will have a look at that...
     

Share This Page