Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iPhone开发人员处理文件列表_Iphone_File_Nsarray - Fatal编程技术网

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:
筛选出目录。有关更多信息,请参阅