Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the feature of -[NSURL isFileReferenceURL]?

The method -isFileReferenceURL is define on NSURL class but I can't figure out what this method is. I thought this determines whether the URL points actual file or not, but it isn't. It returns NO even when the file exist. The manual says just

isFileReferenceURL Returns whether the URL is a file reference URL.

- (BOOL)isFileReferenceURL Return Value YES if the URL is a file reference URL; otherwise, NO.

Availability Available in iOS 5.0 and later. (Symbol is present in iOS 4, but performs no operation.) Declared In NSURL.h

What is this method? What is the file reference URL? When does this method returns YES?

like image 894
eonil Avatar asked Feb 02 '13 19:02

eonil


1 Answers

A file reference URL is a special URL that refers directly to a file, rather than to "whatever file is at this path". This allows it to still point to the file if the user moves it, for example, which is very useful. You can create a file reference URL by calling the -fileReferenceURL method on any regular file URL.

like image 64
Catfish_Man Avatar answered Nov 11 '22 22:11

Catfish_Man