iOSAaronDavid
iOSAaronDavid

Reputation: 140

Inserting attributesOfItemAtPath into NSFileManager

NSDictionary * properties = [[NSFileManager defaultManager] attributesOfItemAtPath:myString error:nil];

I need this to work with a NSURL instead of myString.

I'm still new at this.

Upvotes: 0

Views: 298

Answers (1)

mahal tertin
mahal tertin

Reputation: 3414

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]) {

Upvotes: 2

Related Questions