• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSWorkspace issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWorkspace issue


  • Subject: Re: NSWorkspace issue
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 07 May 2014 00:58:21 -0500

On May 7, 2014, at 12:02 AM, Varun Chandramohan wrote:

>    NSURL *fileURL = [NSURL URLWithString:@"/Users/usr/Desktop/libd.dylib"];

This is not correct.  +[NSURL URLWithString:] expects a valid URL string.  What you're providing is a file path string, which is not a URL string.  A URL string might be "http://www.apple.com"; or "file:///Users/usr/Desktop/libd.dylib".  However, never just prepend "file://" to a file path to try to make it into a URL string.  That doesn't correctly handle a path which contains characters which are not valid in URLs.

The correct thing to do is use +[NSURL fileURLWithPath:] or a similar method.

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


  • Follow-Ups:
    • Re: NSWorkspace issue
      • From: Varun Chandramohan <email@hidden>
References: 
 >NSWorkspace issue (From: Varun Chandramohan <email@hidden>)

  • Prev by Date: NSWorkspace issue
  • Next by Date: Re: How to convert a UTF-8 byte offset into an NSString character offset?
  • Previous by thread: NSWorkspace issue
  • Next by thread: Re: NSWorkspace issue
  • Index(es):
    • Date
    • Thread