New topic: 

Security Scoped Bookmarks are unreliable.

<http://forums.realsoftware.com/viewtopic.php?t=47798>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        rowlands          Post subject: Security Scoped Bookmarks are 
unreliable.Posted: Mon May 06, 2013 12:02 am                                 
Joined: Fri Sep 30, 2005 11:00 am
Posts: 576
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             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to