我的问题是,NSFileManager 从哪个目录开始,我真的很困惑,因为当我运行代码告诉我我在哪个目录时,它只是输出 /. 我也可以将目录更改为 /private/var 但不能更改为应用程序所在的 /mobile 和 /mobile/applications。贝娄是我的代码。
NSString *currentpath;
filemgr = [NSFileManager defaultManager];currentpath = [filemgr currentDirectoryPath];
NSLog (@"Current directory is %@", currentpath);
if ([filemgr changeCurrentDirectoryPath: @"/private/var/mobile"] == NO)
NSLog (@"Cannot change directory.");
currentpath = [filemgr currentDirectoryPath];
NSLog (@"Current directory is %@", currentpath);
label.text = currentpath;
提前致谢。