Re: Trying to understand a permissions failure when writing to ~/Desktop
Re: Trying to understand a permissions failure when writing to ~/Desktop
- Subject: Re: Trying to understand a permissions failure when writing to ~/Desktop
- From: sqwarqDev <email@hidden>
- Date: Thu, 28 Jan 2016 12:54:53 +0700
On 28 Jan 2016, at 12:50, Dev Sqwarq <email@hidden> wrote:
> On 28 Jan 2016, at 12:36, Graham Cox <email@hidden <mailto:email@hidden>> wrote:
>
> The app *has* been sandboxed in the past during development, so wondering if there’s some info cached somewhere that needs clearing?
Hey Graham
Don’t know if anyone’s confirmed this already, but it’s definitely a problem local to you.
I can write from my unsandboxed app (Xcode 7, OS X 10.11) like so without issue:
NSError *myErr;
NSURL* desktopURL = [[NSFileManager defaultManager] URLForDirectory:NSDesktopDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&myErr];
NSURL *fileURL = [desktopURL URLByAppendingPathComponent:@"somefile.txt"];
NSString *hw = @"hello world";
[hw writeToURL:fileURL atomically:YES encoding:NSUTF8StringEncoding error:&myErr];
Best
Phil
@sqwarqdev
_______________________________________________
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