0
我想检索资源文件夹中具有.html
扩展名的文件名称的数组。我已经这样做了:如何返回ios中Resources文件夹中所有文件的名称?
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Resources"];
NSError *error = nil;
NSArray *documentArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:&error];
for (int i=0; i < [documentArray count] - 1; i++) {
NSLog(@"value %@", [documentArray objectAtIndex:i]);
}
但for循环连续显示为空。任何人都知道我该如何完成这项任务?谢谢
好吧......但现在它返回所有文件。我如何指定html扩展? – adrian