Since I come from a world where C/C++ are my gods , I use C functions to do some basic File I/O to basically store my levels and score.
The problem is the files apparently get saved to the home folder on my Mac.
So I'd like some explanation where and how are files are normally stored on the iPhone.
May I simply use fscanf and fprint and be sure nobody will delete or access the files or should I switch to some database for storing that data ?
File I/O
(3 posts) (3 voices)-
Posted 1 year ago #
-
There's a few ways
You can use NSUserDefaults if your only looking into saving small amounts of data.
http://stackoverflow.com/questions/4646879/how-to-save-options/4647982
If there's a hefty amount of data you can save it to an sqlite database.
Thats a 4 part tutorial using sqlite.
As far as i'm aware, no one can access/edit files within your app's app bundle. Not sure if this is true on jailbroken phones.
Posted 1 year ago # -
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/RuntimeEnvironment/RuntimeEnvironment.html#//apple_ref/doc/uid/TP40007072-CH2-SW10 is another thing to look at for storing files, if you don't want to switch to sqlite or CoreData.
Of course if you use sqlite directly, you'll still want to read the above. ^_^
In fact, that whole document is probably worth reading. ^_^
Posted 1 year ago #
Reply
You must log in to post.