Re: NSURL vs NSFileManager
Re: NSURL vs NSFileManager
- Subject: Re: NSURL vs NSFileManager
- From: Dustin Voss <email@hidden>
- Date: Wed, 16 Apr 2003 19:50:14 -0700
On Tuesday, April 15, 2003, at 08:11 PM, Yuhui wrote:
Hi,
It seems that I've encountered an interesting problem. My program
lists the sound files in /System/Library/Sounds and ~/Library/Sounds.
It seems that if I get the file names via NSFileManager, then I don't
have to worry about localized folder names. But if I use NSURL to get
the file names (to play via Quicktime, for example), then it'll choke
on the localized folder names.
I don't think my assumption above is wrong, because previously, I used
NSSound's initWithContentsOfFile:byReference: to play the AIFF files
in those folders, and everything worked fine, but when I switched to
using NSMovieView (using NSMovie's initWithURL:byReference:), problems
started appearing.
So does NSURL choke on localized folder names? If so, is there a
workaround? I thought of using FSFindFolder, but it seems to list only
the "top level" folders, e.g. /System/Library or ~/Library, but not
the Sounds (or any of the lower level) folders, which might have
localized names. Or is there a way to convert NSFileManager's paths
into localized NSURLs? I used NSURL's fileURLWithPath: method, but it
still seems to choke.
FSFindFolder is the way to go. There are more folder types than are
listed in the documentation. Check Folders.h for them all.
The sound folders are kSystemSoundsFolderType, kAudioSoundsFolderType,
kAudioSoundBanksFolderType, kAudioAlertSoundsFolderType, within the
domain specified in the vRefNum parameter.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.