On Jan 8, 2015, at 2:51 PM, Steve Mills <sjmi...@mac.com> wrote:
> 
> I'm having a problem with my app on 10.9 that I'm not sure about. The user 
> chooses a folder via NSPathControl, then I use that to do an NSMetadataQuery 
> for all images inside that folder. I don't have code signing turned on for 
> this app yet, but I do have the Sandbox capability turned on. (This is my 
> first personal project since all this stuff has been introduced.)

Sandboxing requires code signing, because that’s how it associates persistent 
data with your app (including as you produce new versions of the binary).

> 
> If I launch my app, choose a folder, I can run my search on it and everything 
> is fine. That folder gets stored in user defaults via a binding on the path 
> control.

Make sure you’re not just storing a plain path in NSUserDefaults. To maintain 
access to a resource across app launches, you need to use a security-scoped 
bookmark. This is an NSData that is created from an NSURL via 
-bookmarkDataWithOptions:…

Read the Security Scoped Bookmarks and Persistent Access section of the App 
Sandbox Design Guide for more, including what entitlements you need to enable 
to save the appropriate kind of bookmark (app-scoped): 
<https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html>

> And then it immediately goes off with results from a completely different 
> folder:

Not sure what’s happening here; this might be Spotlight trying to do its best 
to fulfill your request.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to