沙盒目录:
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];
}