NSDictionary * properties = [[NSFileManager defaultManager] attributesOfItemAtPath:myString error:nil];
我需要使用NSURL而不是myString。
我还是新手。
答案 0 :(得分:2)
NSURL *myURL; // assume this is filled with a file:// URL
NSDictionary * properties = [[NSFileManager defaultManager] attributesOfItemAtPath:[myURL path] error:nil];
// Alternatively for example Creation Date
NSDate *creationDate = nil;
BOOL success = [myURL getResourceValue:&creationDate forKey:NSURLCreationDateKey error:NULL]) {