Domanda

I would like to use a NSAlert in my OSX application to deal with user authentication.

The answer to this question pop up style dialog covers the basics but I can't figure out how to expand a accessoryView to include two inputs and a label for each.

This produces a single text input:

NSAlert *myAlertView = [[NSAlert alloc]init];

NSTextField *input = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)];
[input setStringValue:@""];
[myAlert setAccessoryView:input];

Any suggestions would be greatly appreciated.

È stato utile?

Soluzione

At the point where you start needing to add inputs, what you are creating is no longer an alert dialog. Create a NSPanel in the Interface Builder with the necessary controls and use that instead.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top