私の質問は、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;
前もって感謝します。