Anton Chuiko Anton Chuiko - 4 months ago 14
Objective-C Question

NSURL returns file's id instead of file's path

I make a Drag&Drop feature. And my NSURL returns file's id instead of file's path.

Code:

fileURL = [NSURL URLFromPasteboard:[sender draggingPasteboard]];


What I receice:


file:///.file/id=6571367.686377


What I want to receive:


/Users/Desktop/someFile.png


How to fix this?

Thank you.

Answer

it's an NSURL object, so it's just

filePath = [fileURL path];