【问题标题】:How do I find filenames of files in my iPhones Documents folder?如何在我的 iPhones Documents 文件夹中查找文件的文件名?
【发布时间】:2011-10-23 21:12:51
【问题描述】:

如何获取 iPhone SDK 上 Documents 文件夹中文件名的最后一部分。

/Users/user/Library/Application Support/iPhone Simulator/5.0/Applications/apptext/Documents/File.txt

我想要显示 File.txt 的部分,并忽略路径的其余部分,我将如何使用 iPhone SDK 做到这一点?

【问题讨论】:

    标签: iphone ios file


    【解决方案1】:
    NSString *path = "/Users/user/Library/Application Support/iPhone Simulator/5.0/Applications/apptext/Documents/File.txt"
    
    NSString *name = [path lastPathComponent];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多