从URL文件夹中获取文件名

时间:2012-11-01 06:17:27

标签: iphone ios xcode url

如何从文件夹URL获取所有文件名?下面的代码返回null。

path = @"http://localhost/urlFolder/images/";

NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL];

1 个答案:

答案 0 :(得分:0)

您是否尝试过NSFileManager

的其他方法
- (NSArray *)contentsOfDirectoryAtURL:(NSURL *)url includingPropertiesForKeys:(NSArray *)keys options:(NSDirectoryEnumerationOptions)mask error:(NSError **)error

您可以使用contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:代替contentsOfDirectoryAtPath:error:

试试吧。快乐的编码。 :)

相关问题