我想做这样的事情NSAlert
:
如您所见,“返回”按钮是第二个。我怎样才能做到这一点?
这是我用来创建我的代码的示例NSAlert
,但第一个按钮获得了焦点:
NSAlert *alert = [[NSAlert alloc] init];
[alert setMessageText:@"Are you sure you want to disconnect?"];
[alert addButtonWithTitle:@"Disconnect"];
[alert addButtonWithTitle:@"Cancel"];
[alert runModal];
我想关注“取消”按钮。有任何想法吗?谢谢!