Re: URLWithString fails to fails with bad string
Re: URLWithString fails to fails with bad string
- Subject: Re: URLWithString fails to fails with bad string
- From: Graham Cox <email@hidden>
- Date: Wed, 25 Nov 2009 17:21:38 +1100
On 25/11/2009, at 5:14 PM, email@hidden wrote:
> This returns a non-nil value:
> NSURL * url = [NSURL URLWithString:@"sdsds"];
>
> The docs say this should fail. RFC 1758 looks for the string to begin with a scheme, eg http:
> I would expect a malforrned string, ie, htt: to work, since URLWithString doesn't distinguish between "htt:" and "http:", but if there is no colon, it should return nil. Are the docs wrong, or am I missing something?
That's a valid URL. With no scheme specified, the string is taken to refer to a file in the current directory.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden