Removing the file:/// prefix from URL path
filePath.path
is what you're looking for. You don't want to "remove file:///
." You just want the path part of the URL.
Note that this will leave the first /
. I guess you could remove that, but it's unclear why that would be a good idea, since it's part of the path. (If you're gluing this together with other strings that might end in /
, it's better to use path methods like stringByAppendingPathComponent:
to get rid of doubled-slashes.)