documents folder is empty

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

documents folder is empty

Post by jmburnod » Mon Oct 01, 2012 6:58 pm

Hi All
I add a folder in the copy files pan of the standalone setting but the documents folder is empty in the device after i uploaded the app.
What I forget ?
I use LC 5.02 and xCode 4.2.1
Jean-Marc
https://alternatic.ch

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: documents folder is empty

Post by gpb01 » Mon Oct 01, 2012 7:22 pm

Hi,
probably your folder is located into the special folder "engine" (Read ONLY).

From dictionary : "engine - The folder containing the built standalone engine (i.e. the bundle). This is useful for constructing paths to resources that have been copied into the bundle at build time."

Guglielmo

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Mon Oct 01, 2012 7:53 pm

Hi,

Thank for your reply but for me a folder added in the copy files pan will be copied in the documents folder of the sandbox.
I'm right ?

Best regards

Jean-Marc
https://alternatic.ch

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: documents folder is empty

Post by Klaus » Mon Oct 01, 2012 8:52 pm

Bonsoir Jean-Marc,
jmburnod wrote:Hi,
Thank for your reply but for me a folder added in the copy files pan will be copied in the documents folder of the sandbox.
I'm right ?
No :D

Everything you add in the "copy files" section will be found in -> specialfolderpath("engine") on the device. No automatisms here!
You, the developer, need to take care of this, means you need to copy that folder resp. its content to -> specialfolderpath("documents")


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Mon Oct 01, 2012 10:45 pm

Hi gpb01 and Klaus,

Sorry i am wrong, I was sur i used this way to copy file in the documents folder. :oops:
I must to find an other way

Best regards

Jean-Marc
https://alternatic.ch

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: documents folder is empty

Post by gpb01 » Tue Oct 02, 2012 7:47 am

Hi Jean-Marc,
you have different solutions ...

1. on startup, the first time, you can copy your folder from the "engine" folder into the "document" folder

2. you can set the "document sharing" flag and you can access the "document" folder from iTunes

3. you can trasfer file into the "document" folder from the network (e.g. FTP, Dropbox, ...)

... and don't forget the Apple rules for the "document" folder or ... your App will be rejected ;)

Guglielmo

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Tue Oct 02, 2012 3:16 pm

Ciao Guglielmo,

And thank for your help.
I need a lot of files in the documents folder, essentially pictures and sound files (rrenarrator don't work in french)
more less 200 Mo. I think copy file from the engine folder is not a good way.

ITunes and network ways are probably better.

I'm interested to know where i can see the Apple rules for the "document" folder
Do you have an URL for that ?

Best regards

Jean-Marc
https://alternatic.ch

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: documents folder is empty

Post by gpb01 » Tue Oct 02, 2012 4:57 pm

Bonsoir Jean-Marc,

on "File System Basics" http://developer.apple.com/library/ios/ ... rview.html, under the section "iOS Standard Directories: Where Files Reside" and "Where You Should Put Your App’s Files" you will find some info.

The problem is that Apple want to avoid large backups on iCloud and, because the user can choose to backup his data on iCloud, Apple reject the App which store a large amount of data on the "document" directory (tipical reject reason is : We found that your app does not follow the iOS Data Storage Guidelines, which is not in compliance with the App Store Review Guidelines).

You have two solution :

1. Use the "library" directory, which is still backuped by iTunes, but not on iClaud.

2. Use the "document" directory, setting for the files the "do not back up" attribute (see the File Attributes, iphoneSetDoNotBackupFile, on LiveCode iOS release notes).

Hope this help,

Guglielmo

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Tue Oct 02, 2012 6:08 pm

Ciao Guglielmo,
Hope this help,
Yes, of course
Thanks a lot

Jean-Marc
https://alternatic.ch

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Sat Oct 06, 2012 3:57 pm

Hi,
I am confused with the copy file pan. :?
I added a folder in the copy file pan and i see it in the documents folder.
I used the same version of liveCode 5.0.2 and xCode 4.2.1

Jean-Marc
https://alternatic.ch

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: documents folder is empty

Post by gpb01 » Sat Oct 06, 2012 4:02 pm

jmburnod wrote:Hi,
I am confused with the copy file pan. :?
I added a folder in the copy file pan and i see it in the documents folder.
I used the same version of liveCode 5.0.2 and xCode 4.2.1

Jean-Marc
Hi Jean-Marc,
a little more details would be better ...

In which copy file pan ? LiveCode ? iTunes ?

Where you see the file ? In the Simulator ? In the real device ?

Guglielmo

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Sat Oct 06, 2012 4:09 pm

Hi Guglielmo,
Thank a lot for the reply
In which copy file pan ? LiveCode ? iTunes ?

In LiveCode
Where you see the file ? In the Simulator ? In the real device ?
In the organizer window of xCode

Jean-Marc
https://alternatic.ch

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: documents folder is empty

Post by Klaus » Sat Oct 06, 2012 4:51 pm

Bonsoir Jean-Marc,

well, if you or (an erlier version of) your app did NOT do this, then this is clearly a case of MAGIC! :D
No, honestly, this does NOT happen automatically, never!


Best

Klaus

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: documents folder is empty

Post by jmburnod » Sat Oct 06, 2012 5:35 pm

Guten Abend Klaus,
I tried the same with LC 5.5.2 and the folder documents is empty as expected
I did also an other try with 5.0.2 and the folder documents is empty as expected

Ok i understand i must give up this way

Best

Jean-Marc
https://alternatic.ch

Post Reply