Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Jul 29, 2014 3:58 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Problem accessing sandboxed app container folder
PostPosted: Tue Dec 04, 2012 4:14 pm 
Offline

Joined: Sun May 27, 2012 4:01 pm
Posts: 6
I have a sandboxed app that needs to open\save its configuration data in the applications container folder (I understand that this is where a sandboxed application has full read write access to.

The problem is that when I try to reference that folder it will crash the compiled application.

The code that crashes it is -
DocumentsFolder=SpecialFolder.UserLibrary.Child("Containers").Child("MyAppID").Child("Data").Child("Documents")

(DocumentsFolder is already declared as a folderitem).

If I run this without it being sandboxed then it works fine.

When sandboxed it gives this error -
An exception of class NilObjectException was not handled. The application must shut down.

Any help with this would be much appreciated as this is driving me crazy.

Thanks


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Tue Dec 04, 2012 4:39 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
try
DocumentsFolder=SpecialFolder.ApplicationData.Child("MyAppID").Child("Data").Child("Documents")

_________________
Norman Palardy (Real Software)


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Tue Dec 04, 2012 4:53 pm 
Offline

Joined: Sun May 27, 2012 4:01 pm
Posts: 6
Unfortunately that folder does not exist when the app is installed, as that is the application support folder, not the containers folder.


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Tue Dec 04, 2012 5:07 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Which OS ?
I'm assuming OS X

_________________
Norman Palardy (Real Software)


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Tue Dec 04, 2012 8:53 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
azzanet wrote:
Unfortunately that folder does not exist when the app is installed, as that is the application support folder, not the containers folder.


You should access the "Application Support" folder, the container is created for your application when it is launched. I do believe that trying to directly access the 'Container' folder is not allowed as your application does not have access to the users library folder. When you access the "Application Support" folder, it actually accesses the one within the container.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Fri Dec 07, 2012 4:29 am 
Offline

Joined: Sun May 27, 2012 4:01 pm
Posts: 6
Thank you Rowlands, you are absolutely right.


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Fri Dec 07, 2012 8:03 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
azzanet wrote:
Thank you Rowlands, you are absolutely right.

Glad I could help.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
 
 Post subject: Re: Problem accessing sandboxed app container folder
PostPosted: Thu Feb 07, 2013 8:57 am 
Offline
User avatar

Joined: Tue Oct 24, 2006 3:38 am
Posts: 148
Location: Ger
Means, when your app starts, let it check for "Data".child("Documents") in its Application Support folder (which can be created by source code, if they do not exist), and Mac OS X mirrors the access to the Container?

_________________
This is REALbasic 2011r3 on a MacBook Pro Late '10 ("MacBookPro6,2") with Mac OS X 10.8.3


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group