Вставка attributesOfItemAtPath в NSFileManager

#objective-c #nsurl #nsfilemanager

#objective-c #nsurl #nsfilemanager

Вопрос:

NSDictionary * свойства = [[NSFileManager defaultManager] attributesOfItemAtPath:Ошибка myString: ноль];

Мне это нужно для работы с NSURL вместо myString .

Я все еще новичок в этом.

Ответ №1:

 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:amp;creationDate forKey:NSURLCreationDateKey error:NULL]) {