saveImage() and WriteFile()

Hello guys,

I am saving data to the local codea assets folder for later collection. I was wondering whether the data is ‘safe’ even when the app is turned off or if the ipad is shut off before I have had a chance to ‘sync’ the assets?

When does codea decide to delete the data from saveImage() if I havent synced it?

Cheers,

The data is there until you delete it. It’s there even when you load a new version of Codea.

@dave1707 Ah very good, that means this method of saving data locally is viable for my surveys.

I’ve had to resort using this method for now, because I couldnt find a way to add .h and .c libraries to my main.lua code in xcode, have you ever had to do this before?

I am having some issues with SaveImage(). For the asset key, I have been using “Documents:sample_preview”. It works fine on codea runtime, but once I converted it to xcode ipa, it gives the error “Invalid sprite pack name”

Maybe try Project:sample_preview

The saveimage help file says only Dropbox: and Documents: are allowed. Not sure if it is because I did not use “automatically include assets” in the export of project.

Just tried using “Project:sample”. Still gives same error. I can’t be the only one having this problem right?

If you don’t get any replies, perhaps try PMs to a couple of people who have published apps (see thread at very top of page)