沙盒目錄:
Documents:文檔目錄,要保存程序聲稱的數據,會自動備份到iCloud中
如果保存了下載的數據,程序提交 直接被拒絕
tmp:臨時文件,系統會自動清理。重新啓動,就會清理
Caches: 緩存
Preferences:偏好設置
manbundle 路徑
給程序打斷點 輸入
po NSHomeDirectory()
/Users/apple/Library/Developer/Xcode/DerivedData/02-表格圖片下載-dtuhlnxqskojpdfemowsszplsciy/Build/Products/Debug-iphonesimulator/
沙盒路徑
/Users/apple/Library/Developer/CoreSimulator/Devices/AA938C24-98DC-4F4A-89E6-EEB4CFA4179D/data/Containers/Data/Application/1313B119-0A26-496F-8CA9-621FB9C6B1F7
po = ptint object
//獲取沙盒地址
- (NSString *)cachePathWithUrl:(NSString *)urlStr
{
// 1. 獲得緩存的路徑
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask, YES)lastObject];
// 2. 把路徑跟urlStr拼接起來
// http://p17.qhimg.com/dr/48_48_/t01077fd80ffb5c8740.png
return [cachePathstringByAppendingPathComponent:urlStr.lastPathComponent];
}