作者:wangzz
转载请注明出处
/* 沙盒下主目录路径 */
NSString *homePath = NSHomeDirectory();
NSLog(@"path:%@",homePath);
/* 沙盒下myApp.app路径 */
NSString *myAppPath = [[NSBundle mainBundle] bundlePath];
NSLog(@"myAppPath:%@",myAppPath);
/* Documents路径 */
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
NSLog(@"documentsPath:%@",documentsPath);
/* Library路径 */
NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) firstObject];
NSLog(@"libraryPath:%@",libraryPath);
/* Library目录下的Caches路径 */
NSString *cachesPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
NSLog(@"cachesPath:%@",cachesPath);
/* Library目录下Preferences路径 */
NSString *preferencesPath = [NSSearchPathForDirectoriesInDomains(NSPreferencePanesDirectory, NSUserDomainMask, YES) firstObject];
NSLog(@"preferencesPath:%@",preferencesPath);
/* 沙盒下tmp路径 */
NSString *tmp = NSTemporaryDirectory();
NSLog(@"tmp:%@",tmp);