Data Stacks too big for Apple

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Mike Nagel
Posts: 1
Joined: Sun Jul 28, 2013 9:48 pm

Data Stacks too big for Apple

Post by Mike Nagel » Sun Jul 28, 2013 10:04 pm

I've had an app rejected a couple of times by Apple to due data stacks being too big. They suggest that I set the stack files' "do not backup" attribute. The problem that I'm running into is that I cannot seem to set the attribute for a stack residing in the "engine" area.

When a user opens the app for the first time, it throws a copy of the "engine" stack into the documents area. The app uses the "documents" stack to maintain data within the app. At some point, however, users will want to reset the app to its baseline. When this happens, the "engine" stack is once again copied to the "documents" stack.

The code below executes when the "Launcher" stack is initially opened. The "documents" stack successfully has its "do not backup" flag set, but the "engine" stack does not.

I've seen posts where folks suggest that rather than use the documents area, the cache area should be used. I'm concerned that this would not work as users may lose the data stacks if the cache folder is flushed.

Any help would be greatly appreciated!

-- Mike

--------------------------------------------------------------------------------------

on preopenstack

if the environment is "mobile" then
put (specialFolderPath("Documents") & "/ShipCards.livecode") into tPathToDatabase
put (specialFolderPath("engine") & "/ShipCards.livecode") into tPathToStartLoc

try
if not (there is a file tPathToDatabase) then
put url ("binfile:" & tPathToStartLoc) into temp
put temp into url ("binfile:" & specialfolderpath("Documents") & "/ShipCards.livecode")
wait 5 milliseconds with messages
end if

catch pErr
answer pErr
end try

-- Set do not backup flag
iphoneSetDoNotBackupFile tPathToDatabase, true
iphoneSetDoNotBackupFile tPathToStartLoc, true

if iphonedonotbackupfile(tPathToDatabase) is false then
answer "Documents Attribute Not Set"
else
answer "Documents Attribute Set!"
end If

if iphonedonotbackupfile(tPathToStartLoc) is false then
answer "Engine Attribute Not Set"
else
answer "Engine Attribute Set!"
end If

end if

end preopenstack

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Data Stacks too big for Apple

Post by Mark » Wed Aug 07, 2013 1:00 am

Hi,

Would it help if you compress those stacks before making a standalone and decompress them when writing them to the documents folder? I don't see a way to set the dontBackup flag for files that are part of the standalone.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply