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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to