ProjectData vs IO.files

This is just sort of a phish to get some opinions as to which is better for what purpose and why. I’m at the point where I need to start saving serialized data and I’m not quite sure what ProjectData is and how it works. Thanks!

You should avoid ProjectData, because it is not deleted when you destroy the project (and maybe also rename it?). You can use LocalDat or Global data but for few things (high score, last level etc…). For bigger data saving i use io.write to write into a text file in getContext()/documents (you cannot write elsewhere… Or you can, but it is lost when you restart the project). Lua has great text processong capabilities, so text files are good.

@syntonica Actually, none of the data (local, project, global) is removed when you delete a project. At least with global data you can use listGlobalData to see the data created by any project and remove what you need to. With local or project data, you have to be in that project to see/remove it. So if you delete a project without removing the data first, that data will remain in memory until you remove Codea, unless you remember the project name and create that project to delete the data. As for saving info, what you use (data or files) will depend on the amount of info you want to save.

I will be saving config files and the enduser will be able to create and delete config files as well. The permanent ones will be stored on tabs. The whole thing is kind of a pain since I have three different types of configs that will need to collected to display a list to the user.

I am looking at which storage is best when exporting to Xcode. I guess I should have mentioned that. #-o

@syntonica Sorry, can’t help with Xcode. I only use the iPad.

Since there’s no way in Codea to pull a directory listing (that I can find), looks like ProjectData or Local Data it is…