在網上找了些資料,但是因爲Xcode的版本問題,煩的很。
最實在的方法就是你在工程裏面把路徑打出來,然後去找。
1.在工程裏打出路徑:(這裏打出了caches的路徑)
NSString *caches = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
NSLog(@"caches:%@",caches);
//caches:/Users/wuwenhao/Library/Developer/CoreSimulator/Devices/E40580E3-1130-4B02-B4E4-6AFE0BBAFAB9/data/Containers/Data/Application/70E0BD51-A687-4B9C-A5CC-F88DC3AE98D4/Library/Caches
2.在Finder裏面選擇前往文件夾,將打出來的路徑粘貼上去查找就好了:
最後,附上兩行終端命令,看到的比較多:
defaults write com.apple.finder AppleShowAllFiles -bool true //顯示Mac裏面隱藏的文件夾
defaults write com.apple.finder AppleShowAllFiles -bool false //隱藏Mac裏面原本隱藏的文件夾
在終端輸入完成後,強制退出Finder,重新啓動Finder就OK了