更新时间:2021-08-07 01:08:44
您可以像这样获得 Resources
目录的路径,
You can get the path to the Resources
directory like this,
NSString * resourcePath = [[NSBundle mainBundle] resourcePath];
然后将 Documents
附加到路径中,
Then append the Documents
to the path,
NSString * documentsPath = [resourcePath stringByAppendingPathComponent:@"Documents"];
然后你可以使用 NSFileManager的任何目录列表API
。
NSError * error;
NSArray * directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsPath error:&error];