Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iLoveDeveloping

Suspended
Original poster
Sep 24, 2009
596
2,366
Ireland
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?
 
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.
 
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.

Thanks, i will have a look at that...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.