On 24/08/2012, at 10:11 AM, Kyle Sluder <k...@ksluder.com> wrote:

> Just FYI, this is not a valid URL. The space in "iPhoto Library" needs
> to be percent-encoded.

It is, in fact. I retyped it in Mail.

>> So I think I'm correct to be using [NSURL URLWithString:] here (tell me
>> if that's not right!) and that does point to the right file and
>> everything is now working.
> 
> In general, no. You should not use +URLWithString: to create an NSURL
> from a filesystem path. Use +fileURLWithPath:isDirectory: instead. It
> handles cases like percent-encoding.

Hang on, given the above string (which as far as I can tell is a 'proper' URL 
and not just a path), +URLWithString works fine and 
+fileURLWithPath:isDirectory makes a complete hash of it.

What is +URLWithString: for, if not this?

--Graham



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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

This email sent to arch...@mail-archive.com

Reply via email to