Why are paths depracated in favor of NSURL?

  • Most of the recent API from Apple refer to files with NSURL instead of
    NSString paths.  All I get out of this is the pain of having to write
    a couple extra lines of code.  What are the advantages that I'm not
    appreciating?

    Jerry
  • Jerry Krinock wrote:

    > Most of the recent API from Apple refer to files with NSURL instead of
    > NSString paths.  All I get out of this is the pain of having to write
    > a couple extra lines of code.  What are the advantages that I'm not
    > appreciating?

    I'm not sure if deprecated is the right word, but I'd suggest that
    URLs are preferred over simple paths because if you're going to
    restrict yourself to brittle string-based file references you might
    as well at least pick a form that's flexible and extensible.
    Something that can reference locations other than locally-mounted
    file systems, for example.