hey does anybody know if you actually need to do this in ios 4? I was pretty sure that the text would stay in there with multitasking, but when i actually terminated my application and restarted it, it had an error (SIGKILL)
@iPhpMaster Bucky already made ton's of tutorials, he is doing it for free and if you want a tutorial about win32 search youtube, there are other people that teach it to. But leave bucky alone.
Email me at brandoncthompson7@yahoo.com and put the subject as "Pre-Paid Legal" to hear about the company I am with now and they have been around for 40 years and millions of people are making serious money with us. I have proof and tools of how to make it work and I also have contacts that have been VERY successful with this company. thank you, Brandon.
@PanzrKunst thanks for pointing out that you needed that extra '/' in the file path format. I found that it would work fine in the simulator without it, but I needed to add it in order for it to work on my actual phone.
I've seen all your iPhone dev tutorials so far and I must say that this one left me in the dust. I guess my poor Obj-C knowledge has finally caught up with me.
I must also say that this seems like a whole lot of work just to save and recall a single string. Please tell me it's easier than this.
@PanzrKunst If you run this on a device without multi-tasking (I'm using ipod touch 2nd gen) the origional code works fine (with exception to adding the / for the file path) otherwise i'm not sure which method is called if you double tap the menu button and terminate the application that way.
@PanzrKunst
I couldn't enter this code....I'm getting an error saying that errorReading is not declared. I think it's because of the '&' you placed there despite removing that, it didn't work for me.
Second bug: There is a slash missing then you initialize the file path. It should be '[docsFolder stringByAppendingFormat:@"/myFile.plist"]'
Third bug: reading the file content as you do didn't work in my setup. I used 'NSString *fileContents = [NSString stringWithContentsOfFile:filePath encoding:NSUnicodeStringEncoding error:&errorReading]' instead. But this wasn't enough: if the file is a pList, it's still read incorrectly that way. Don't use any extension, or maybe "txt", but not "plist"
First, thank you Bucky for all those iPhone dev tutorials, I've been following them all and so I know iPhone dev thanks to you :)
But there are bugs in this tutorial. First bug: since iPhone multitasking, 'applicationWillTerminate' won't be triggered when you click the home btn. So 'applicationWillResignActive' must be used instead. Similarly, 'viewDidLoad' is only triggered "the first time". You therefore need to read the file content on 'ApplicationDidBecomeActive'.
Can we view the file that we saved, when working with the simulator? ie: can we see the contents of the applications document folder without writing an app to do this?
@bigmike4ya2003 I am having the same results are you are. I think 4.0 saves users states automatically now but Im trying ti figure out how exactly to save info for when the application is completely terminated so I can save highscores