NSURL vs NSFileManager
NSURL vs NSFileManager
- Subject: NSURL vs NSFileManager
- From: Yuhui <email@hidden>
- Date: Tue, 15 Apr 2003 22:11:07 -0500
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.
Thanks.
Yuhui
_______________________________________________
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.