My App was rejected because my app does not follow the iOS Data Storage Guidelines

I am using “saveLocalData” method for player`s records.
Is it the problem or any ideas?

In particular, they found that on launch and/or content download, my app stores 14.8 MB( which are LUA files in Project.codea folder).
How do I set the property of the folder and the LUA files in the folder to solve the issue?

Or…should I prevent files from being backed up to iCloud and iTunes?

.@CcYen - I use saveLocalData() for high score data in MineSweeper and this was approved by Apple. I don’t think that is the issue. However, I would add the caveat that Apple are not always consistent in their approval processes and it looks like the iOS Data Storage guidelines (introduced with iOS 5) have only recently started to be enforced. Probably because the Documents directory now gets backed up to iCloud.

For each project, a key of the form Project Name_DATA is used to store local data in the com.twolivesleft.Codify.plist which may be found in the Library → Preferences sub folder (i.e. the same location as global data). This folder should be ok.

Project Data saved using saveProjectData is stored in the Data pList in the Documents directory of your App. If you are using this function it could be a problem. The guidelines say:

1. Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the <Application_Home>/Documents directory and will be automatically backed up by iCloud.

As you say, the problem is more likely the Lua files stored in <Application_Home>/Documents/Project.codea. Note that any custom sprites also end up in the Documents Directory (…/Documents/Dropbox.spritepack) and these could also be an issue - in fact, I doubt that your Lua files are 14.8 MB in size, this is likely to be mostly due to the sprites.

Assuming this is the problem (Apple rejection info is typically vague) then you would expect everyone who submits using the current runtime to have the same issue. The answer would appear to be:

2. Data that can be downloaded again or regenerated should be stored in the <Application_Home>/Library/Caches directory.

So the runtime needs to be updated to stick the Lua files and sprites in the Caches directory (or anywhere but /Documents). I could probably have a crack at this but my understanding is that the runtime needs to be updated anyway due to the new features in Codea v1.5 so perhaps it could be done as part of this?

A short term fix may be to prevent backups to iCloud - you could give this a shot while working on a permanent solution.

Sounds like we may need to add a cacheData() series of functions for non-user data. You can use the io.* package in 1.5 to do this in the mean time.