This question is NOT duplicated with Check if NSURL is Local File.
I have two kinds of string path point to local file path and remote file path which may have an HTTP/HTTPS/FTP scheme.
NSString *path = ... ; // like "https://img.server.com/foo.jpeg" or "/Users/myname/Library/Developer/CoreSimulator/Devices/xxxxx/data/Containers/Data/Application/xxxx/Documents/file.txt"
NSURL url1 = [NSURL URLWithString:path];
NSURL url2 = [NSURL fileURLWithPath:path];
I checked the scheme
, fileURL
, isFileReferenceURL
properties, none of them could help me identify whether the NSString path is a local file path or remote file URL.
Please help!