Re: URI de/encoding
Re: URI de/encoding
- Subject: Re: URI de/encoding
- From: gnat <email@hidden>
- Date: Thu, 18 May 2006 13:04:40 -0400
On May 18, 2006, at 10:41, Jim Correia wrote:
<http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/ObjC_classic/Classes/NSString.html#//apple_ref/occ/instm/
NSString/stringByAddingPercentEscapesUsingEncoding:>
<http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/ObjC_classic/Classes/NSString.html#//apple_ref/occ/instm/
NSString/stringByReplacingPercentEscapesUsingEncoding:>
Jim,
Thanks. I looked in NSString (and NSURL) first, but I sometimes miss
the obvious :/
The documentation for -[NSURL path] says:
<http://devworld.apple.com/documentation/Cocoa/Reference/Foundation/
ObjC_classic/Classes/NSURL.html#//apple_ref/occ/instm/NSURL/path>
"If isFileURL returnsYES, the return value is suitable for input
into NSFileManager or NSPathUtilities."
It sounds like you are passing something else to the file manager.
I saw that, so i'm not sure what is going on. The XML file I am
loading is "~/Music/iTunes/iTunes Music Library.xml" which gets
loaded into an NSDictionary object. When I get to that point, I pull
the Location object out of a Track and store it in a NSString. This
path looks something like "file://localhost/Users/gnat/Music/iTunes/
iTunes Music/Compilations/Vespertine/01 Hidden Place.mp3" and
my target NSString would look like "file://localhost/Volumes/test/
Music/01 Hidden Place.mp3". If I pass this to copyPath:, it
returns false (and I can't find an error message anywhere). If I
strip the "file://localhost" and replace the s with spaces, the
copy works fine.
Now that i've figured out how to use the handler: option, the error
it is reporting is "Couldn't open" and the Path is the source (there
isn't a ToPath being populated). One thing I do notice is that the
Path is missing the second / after file: (i.e. file:/localhost
instead of file://localhost), but when I use NSLog to log my source
NSString after copyPath: returns FALSE they are both there.
Thanks,
-dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden