On 22 Feb 2013, at 01:34, Nick wrote:

> Hello.
> I am working on a plugin for Mail.app for Mountain Lion. The problem is
> whenever I try to save a file, I am getting an error. Which can be
> explained by the fact that Mail.app is sandboxed and I am not allowed to
> modify files anywhere on the system.
> So what I do instead - is call
> 
> 
> TempDir = [[[NSFileManager defaultManager] URLForDirectory:
> NSDownloadsDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:
> YES error:nil] path];
> 
> 
> and then create in this TempDir another directory using standard
> NSFileManager functions.
> On my Mail.app it works, on another system - it doesn't (the dir doesn't
> get created). I can't understand why. I was hoping to store a temporary
> file in Downloads, since Mail obviously should have access to this
> directory.

Why should Mail "obviously should have access to this directory”?
> 
> I also tried calling this
> 
> TempDir = [[[[NSFileManager defaultManager]
> URLForDirectory:NSItemReplacementDirectory inDomain:NSUserDomainMask
> appropriateForURL:[NSURL URLWithString:
> @"file:///private/var/tmp/my.great.app"] create:YES error:nil] path]
> retain];
> 
> 
> On my 10.8 system it works, on another - it doesn't (I can't save files to
> TempDir from my plugin). What am I doing wrong?

You’re not consulting/logging the error message for a start . That will tell 
you *why* it fails.
_______________________________________________

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