我有一个代码可以将对象移出路径@“/ Users / playra / Desktop / 2 DivyaLoka /СобраниеТайн”
- (void) setPathProperty:(NSString *)pathProperty
{
_pathProperty = pathProperty;
NSArray* allContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathProperty error:nil];
self.contents = allContents;
[self.tableView reloadData];
self.navigationItem.title = [self.pathProperty lastPathComponent];
}
这一行下面是对象.DS_Store
NSArray* allContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathProperty error:nil];
如何从那里删除它?
答案 0 :(得分:1)
试试这个:
NSMutableArray * dirContents = [[NSMutableArray alloc] initWithArray:docDir];
if([docDir containsObject:@".DS_Store"])
{
[dirContents removeObject:@".DS_Store"];
}