Re: NSString / NSURL
Re: NSString / NSURL
- Subject: Re: NSString / NSURL
- From: Graham Cox <email@hidden>
- Date: Sun, 29 Aug 2010 10:30:42 +0200
On 29/08/2010, at 10:14 AM, Amy Heavey wrote:
> I still get an error:
On what line?
Looking at the code you have mixed string paths and URLs. Pick one or the other and use it consistently. While string paths are becoming deprecated in favour of URLs, it might be easier to just use string paths initially to get it working and then convert to URLs throughout afterwards.
For example, [NSOpenPanel filenames] is deprecated, as it returns the selected files as strings. Use [NSOpenPanel URLs] if you want to use URLs. Similarly for [NSFileManager copyItemAtPath:toPath:error] use [NSFileManager copyItemAtURL:toURL:error].
Mixing two different representations of a file path is what is causing you problems here. Be consistent.
--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