iPhone开发人员处理文件列表
在我的手机应用程序中,我需要将特定路径上的所有文件标题放入一个数组中,我如何才能做到这一点iPhone开发人员处理文件列表,iphone,file,nsarray,Iphone,File,Nsarray,在我的手机应用程序中,我需要将特定路径上的所有文件标题放入一个数组中,我如何才能做到这一点 // Contains the names of all files in the specified directory. NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL]; 如果需要项目的完整路径,只需在path前面加上前缀即可。您还可以使用fileExistsAtP
// Contains the names of all files in the specified directory.
NSArray *files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:NULL];
如果需要项目的完整路径,只需在path
前面加上前缀即可。您还可以使用fileExistsAtPath:isDirectory:
筛选出目录。有关更多信息,请参阅