テキスト フィールドの値を取得してファイルに書き込むココア アプリケーションに問題があります。ファイル パスは、stringWithFormat: を使用して作成され、2 つの文字列を結合します。何らかの理由でファイルが作成されず、コンソールには何も表示されません。これが私のコードです:
//Get the values of the text field
NSString *fileName = [fileNameTextField stringValue];
NSString *username = [usernameTextField stringValue];
//Use stringWithFormat: to create the file path
NSString *filePath = [NSString stringWithFormat:@"~/Library/Application Support/Test/%@.txt", fileName];
//Write the username to filePath
[username writeToFile:filePath atomically:YES];
助けてくれてありがとう