Re: Finding user's Music folder (and others)?
Re: Finding user's Music folder (and others)?
- Subject: Re: Finding user's Music folder (and others)?
- From: Steve Christensen <email@hidden>
- Date: Thu, 17 Sep 2009 21:01:41 -0700
On Sep 17, 2009, at 8:18 PM, Rick Mann wrote:
On Sep 17, 2009, at 20:15:43, Michael Babin wrote:
On Sep 17, 2009, at 10:03 PM, Rick Mann wrote:
Hmm. I take it back. I can't get code calling
NSSearchPathForDirectoriesInDomains() to compile.
NSArray* paths = NSSearchPathForDirectoriesInDomains
(NSMusicDirectory, NSUserDomainMask, false);
error: 'NSMusicDirectory' was not declared in this scope
What do I need to do to get NSMusicDirectory?
Are you building with the 10.6 SDK? NSMusicDirectory is available
in 10.6 and later, according to the docs and the header file
(NSPathUtilities.h).
Well, I thought I had, but I tried again just to be sure. That's
the trick. I just overlooked the line that said "10.6". Thanks!
And if you want to get that path for earlier OS versions, you could
use FSFindFolder:
NSString* musicFolderPath = nil;
FSRef musicFolderRef;
if (FSFindFolder(kUserDomain, kMusicDocumentsFolderType,
kCreateFolder, &musicFolderRef) == noErr)
{
NSURL* musicFolderURL = [(NSURL*)CFURLCreateFromFSRef(NULL,
&musicFolderRef) autorelease];
musicFolderPath = [musicFolderURL path];
}
_______________________________________________
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