I'm working on retrieving a POSIX path to a folder or file from an NSPathControl
after dropping the file or folder onto it.
I'm a beginner, but I was able to get the value from the control (called Destination
) in my code this way:
NSString *filepath;
filepath = [Destination stringValue];
This gives me something like
file://test/My%20New%20Project/
but I'd like to have it in the POSIX path form:
/test/My New Projectbecause I need to pass it to a
NSTask
running a command-line program.
Any suggestion about how to convert the content of this NSString
from an URL format to a POSIX path?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With