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.
我想获取应用程序documents文件夹中的所有文件名,并将它们放在NSMutableArray. 不多也不少。
documents
NSMutableArray
有一个方便的方法NSFileManager:
NSFileManager
NSFileManager *fileManager = [[NSFileManager alloc] init]; NSArray *files = [fileManager contentsOfDirectoryAtPath:documentsDirectory error:nil]; ... [fileManager release];
从 ARC 开始,您当然可以放弃发布声明。