NSURL returns file identifier instead of file path

I am making a drag & drop function. And my NSURL returns the file identifier instead of the file path.

code:

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

What I get:

File: ///.file/id=6571367.686377

What I want to get:

/Users/Desktop/someFile.png

How to fix it?

Thanks.

+5
source share
1 answer

it is an NSURL object, so it just

 filePath = [fileURL path]; 
+4
source

All Articles