【问题标题】:Get file name from URL folder从 URL 文件夹中获取文件名
【发布时间】:2012-11-01 06:17:26
【问题描述】:

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

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

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

【问题讨论】:

  • 请阅读苹果指南文档,请RND关于您的内容然后提出问题,请明确您的问题并详细询问..

标签: iphone ios xcode url


【解决方案1】:

你有没有试过NSFileManager的另一种方法

- (NSArray *)contentsOfDirectoryAtURL:(NSURL *)url includingPropertiesForKeys:(NSArray *)keys options:(NSDirectoryEnumerationOptions)mask error:(NSError **)error

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

试试看。快乐编码。 :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-21
    • 2022-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-17
    • 2010-10-10
    相关资源
    最近更新 更多