Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Aug 18, 2017 10:34 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Security Scoped Bookmarks are unreliable.
PostPosted: Mon May 06, 2013 12:02 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
I'm just writing a post here to warn people that we've discovered that Security Scoped Bookmarks are unreliable and are causing us and our customers headaches.

The most common problem we face is the access timing out before we've finished with the file and also access randomly being denied to files. It seems that if you have a file you need to access frequently, SSBs are _not_ the way to do it.

Using a SSB for a file to be used by Core Image, will cause issues. Core Image is a lazy processor which means it only loads data from the file when it actually renders the image. So you need to gain access when you create the core image object (otherwise it fails) and then you need to regain access when you render (and in some cases regaining access can fail at either point), thus destroying your app.

I would expect that it may have the same behavior for a database application also.

It could of course be my code that I've written for accessing SSBs, but there are other ways to do it and I'm researching them.

For instance so far my tests on using Apple Recent document system, automatically retains access to that file. Before I release the code, I want to do more testing and confirm this with a real shipping application (as that's where I found failures was in a real shipping application, not a demo app).

The other thing I'm investigating is using NSDocument to retain access, according to Apple's docs, access is retained on open NSDocuments when the application quits.

If the above methods work, it also means that RS apps will be able to retain/restore access to previous files on Mac OS X 10.7~7.2 as well.

Some other issues we've encountered with SSBs include retaining a reference to a file within your resources folder will get your app rejected by Apple.

Using SSBs to maintain a Recent Items list, updates the modified date on _all_ recent items when the SSB is created.

If anyone else has found a better solution, I would love to hear from them.

_________________
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  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


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