iOS应用程序沙盒目录结构

获取主要目录路径的方式
沙盒目录
NSLog(@"%@",NSHomeDirectory());

MyApp.app
NSLog(@"%@",[[NSBundle mainBundle] bundlePath]);

tmp
NSLog(@"%@",NSTemporaryDirectory());

Documents
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [paths objectAtIndex:0];
NSLog(@"%@",docPath);

Library
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);
NSString *libPath = [paths objectAtIndex:0];
NSLog(@"%@",libPath);
原文地址:https://www.cnblogs.com/fkunlam/p/4867481.html