Reputation: 2822
How to access file info (such as date created,size etc) about a file in iphone?i need to sort certain files based on the date of creation,size etc..
Upvotes: 1
Views: 479
Reputation: 23722
Try this method:
NSError *error;
NSDictionary* attributes = [[NSFileManager defaultManager]
attributesOfItemAtPath: filePath
error: &error];
You can then query [attributes fileCreationDate]
or [attributes fileSize]
. See NSFileManager.h for the NSFileAttributes
category of NSDictionary
.
Upvotes: 5