次のコードを使用して、NSTextField を NSAlert に正常に追加しました。
NSAlert *alert = [NSAlert alertWithMessageText: @"Password"
defaultButton:@"OK"
alternateButton:@"Cancel"
otherButton:nil
informativeTextWithFormat:@""];
NSTextField *input = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)];
[input setStringValue:@""];
[input autorelease];
[alert setAccessoryView:input];
NSInteger button = [alert runModal];
ただし、NSAlert に表示される NSTextField ではテキストを入力できません。入力した内容が NSTextField に表示されません。Enabled and Editable を YES に設定してみましたが、何も変わりませんでした。