Re: Why not use path-based API? (was: Loading image resources)
Re: Why not use path-based API? (was: Loading image resources)
- Subject: Re: Why not use path-based API? (was: Loading image resources)
- From: Ken Thomases <email@hidden>
- Date: Sun, 14 Sep 2014 08:10:48 -0500
On Sep 14, 2014, at 2:57 AM, Aandi Inston <email@hidden> wrote:
>> No one should be using path-based API any more, generally.
>> You should use URL-based equivalents.
>
> Why? Really, why? Certainly there are APIs where we have to use URL's and
> we have to convert the path into a URL, but where a non-deprecated
> path-based URL exists, what current or future obstacles do you foresee? The
> URL doesn't seem to be more predicable or persistent, for example.
>
> Thanks for any insight. I've been really happy to see the last of the
> old-style colon-separated names and move to something I can understand, a
> pathname.
In addition to what others have said, NSURL can know it represents a file URL and therefore can do smart things like cache file metadata (called resource values in the API).
A string can "look" like a path even when it isn't and it can not look like a path when it is, so NSString can't have any file-specific smarts built into it.
Regards,
Ken
_______________________________________________
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