【问题标题】:List iPhone application document files列出 iPhone 应用程序文档文件
【发布时间】:2010-11-28 20:15:29
【问题描述】:

有没有办法在 iPhone 应用程序的文档文件夹中获取文件的文件名?你是怎么做到的?

【问题讨论】:

    标签: iphone list file document


    【解决方案1】:
    NSFileManager *manager = [NSFileManager defaultManager];
        NSArray *fileList = [manager directoryContentsAtPath:documentsDirectory];
        for (NSString *s in fileList){
            NSLog(s);
        }
    

    【讨论】:

    • 注意:directoryContentsAtPath 已弃用,请改用 contentsOfDirectoryAtPath:error:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-16
    • 1970-01-01
    相关资源
    最近更新 更多