在我的应用程序中,我创建一个目录,然后以下代码起作用:
NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:trackDirectory traverseLink:YES];
NSDate *fileDate = [fileAttributes objectForKey:NSFileModificationDate];
但是,当我尝试获取 NSFileCreationDate 时,它不起作用。
我究竟做错了什么?
据我所知,iPhoneOS 上没有其他日期。这是全部内容attributesOfItemAtPath:
好像:
{
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;
}
所以,你的答案是……你正在尝试访问 iPhoneOS 上不存在的字典键。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)