Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很好奇是否有办法在 iPhone 的目录中搜索文件(位置无关紧要)。
我想从文本文件中加载地址。问题是可能会添加其他文件,我希望能够动态地找到文件并加载数据,而无需对要加载的文件名进行硬编码。
非常感谢!
你要:
NSError *error; [[NSFileManager defaultManager] contentsOfDirectoryAtPath:myPath error:&error]
它为给定目录中的每个文件返回一个 NSString 对象数组。