• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSString stringByAbbreviatingWithTildeInPath and Sandboxing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString stringByAbbreviatingWithTildeInPath and Sandboxing


  • Subject: NSString stringByAbbreviatingWithTildeInPath and Sandboxing
  • From: Jon Baumgartner <email@hidden>
  • Date: Tue, 27 Jan 2015 12:20:37 -0500

My app uses this call, and it worked fine until I sandboxed it. The documentation for this call says:

> For sandboxed apps in OS X, the current home directory is not the same as the user’s home directory. For a sandboxed app, the home directory is the app’s home directory. So if you specified a path of /Users/<current_user>/file.txt for a sandboxed app, the returned path would be unchanged from the original. However, if you specified the same path for an app not in a sandbox, this method would replace the /Users/<current_user> portion of the path with a tilde.

So how do I get /Users/<current_user>/file.txt to output as ~/file.txt when my app is sandboxed?
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing
      • From: Kyle Sluder <email@hidden>
    • Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: NSTableCellView Constraints?
  • Next by Date: Re: NSTableCellView Constraints?
  • Previous by thread: Re: NSTableCellView Constraints?
  • Next by thread: Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing
  • Index(es):
    • Date
    • Thread