Re: NSUserDirectory returns nil
Re: NSUserDirectory returns nil
- Subject: Re: NSUserDirectory returns nil
- From: Kevin Perry <email@hidden>
- Date: Thu, 25 Sep 2014 17:04:43 -0700
NSUserDirectory refers to the “Users” directory, which exists only in the “System” domain (“/Users"). The “User” domain is the home directory (“~”). The combination of NSUserDirectory and NSUserDomainMask results in a nonsensical and nonexistent path (“~/Users”) so it returns nil/empty instead.
-KP
> On Sep 25, 2014, at 4:53 PM, email@hidden wrote:
>
>
>
> Why does [[NSFileManager defaultManager]
> URLForDirectory:NSUserDirectory inDomain:NSUserDomainMask
> appropriateForURL:nil create:NO error:nil]
>
> return nil?
>
>
> [[NSFileManager defaultManager] URLsForDirectory:NSUserDirectory
> inDomains:NSUserDomainMask] returns an empty array.
>
> I am aware of
> NSHomeDir().
>
>
> _______________________________________________
>
> 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
_______________________________________________
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