views:

284

answers:

1

In my app, I create a directory, and then the following code works:

NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:trackDirectory traverseLink:YES];
NSDate *fileDate = [fileAttributes objectForKey:NSFileModificationDate];

However, when I try and get the NSFileCreationDate instead, it doesn't work.

What am I doing wrong?

+1  A: 

As far as I can see, there is no other date on iPhoneOS. Here is what the whole attributesOfItemAtPath: looks like:

{
    NSFileGroupOwnerAccountID = 20;
    NSFileGroupOwnerAccountName = staff;
    NSFileModificationDate = 2009-12-03 21:34:59 -0800;
    NSFileOwnerAccountID = 501;
    NSFileOwnerAccountName = username;
    NSFilePosixPermissions = 420;
    NSFileReferenceCount = 1;
    NSFileSize = 8703;
    NSFileSystemFileNumber = 14066295;
    NSFileSystemNumber = 234881026;
    NSFileType = NSFileTypeRegular;
}

So, your answer is.. you're trying to access a dictionary key that is not present on iPhoneOS.

ohhorob