What is .DS_Store
I hope to list all files in document directory using codes below
for(NSString *path in [manager contentsOfDirectoryAtPath:[self appDelegate].gCurrentPath_AppDelegate
开发者_JAVA百科 error:nil])
{
NSDictionary *modData=[manager attributesOfItemAtPath:
[appDelegate.gCurrentPath_AppDelegate
stringByAppendingPathComponent:path ]
error:nil ];
NSDate * dateModified=(NSDate *) [modData objectForKey:NSFileModificationDate];
NSNumber *fileSize=[modData objectForKey:NSFileSize] ;
FileObj *newobj=[[FileObj alloc] init ];
NSString *ss=[[NSString alloc] initWithFormat:@"%@",path] ;
[newobj setfileName:ss];
[ss release];
[ fileArray addObject:newobj];//fileArray: the data source of UITableView
[newobj release];
}
I found that there is a file with name ".DS_Store' in the list. I browsed the simulator directory and can not found where is this file.
The .DS_Store
file is a file created by Mac OS X that holds meta-information about a directory. You can expect to always find it and can safely ignore it. The file is not shown by the Finder.
精彩评论