eonil
eonil

Reputation: 86065

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?

Upvotes: 9

Views: 2964

Answers (2)

Catfish_Man
Catfish_Man

Reputation: 41821

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.

Upvotes: 24

Dave
Dave

Reputation: 7717

Try using isFileURL. There's a difference between a "File Reference URL" and a "URL that points at a File". ;)

Upvotes: -6

Related Questions