【发布时间】:2014-08-17 21:24:07
【问题描述】:
NSDictionary * properties = [[NSFileManager defaultManager] attributesOfItemAtPath:myString error:nil];
我需要它来使用 NSURL 而不是 myString。
我还是个新手。
【问题讨论】:
标签: objective-c nsurl nsfilemanager
NSDictionary * properties = [[NSFileManager defaultManager] attributesOfItemAtPath:myString error:nil];
我需要它来使用 NSURL 而不是 myString。
我还是个新手。
【问题讨论】:
标签: objective-c nsurl nsfilemanager
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]) {
【讨论】: