将应用程序运行到模拟器上时,它会在Mac上创建一个文件夹,以在“Documents”文件夹中包含应用程序数据.从模拟器中删除应用程序或将某些应用程序设置更改为XCode时,将更改此文件夹.当你有几十个应用程序时,手动找到好的应用程序是一场噩梦.
有没有办法轻松访问此文件夹?
解决方法
要试着回答.如何记录它,像这样:
//App Directory & Directory Contents NSString *appFolderPath = [[NSBundle mainBundle] resourcePath]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSLog(@"App Directory is: %@",appFolderPath); NSLog(@"Directory Contents:\n%@",[fileManager directoryContentsAtPath: appFolderPath]);