[英]How to display dialog box in OS X using Finder Sync Extension and Objective-C
我正在创建具有finder同步扩展名的可可应用程序。 我正在尝试在finder应用程序的某些事件上打开对话框。我是x代码和目标c的初学者。 我在某些事件上尝试了以下代码。
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Delete the record?"];
[alert setInformativeText:@"Deleted records cannot be restored."];
[alert setAlertStyle:NSWarningAlertStyle];
if ([alert runModal] == NSAlertFirstButtonReturn) {
// OK clicked, delete the record
}
但是此代码仅用于显示警报框。 谁能建议我如何获取对话框。
尝试UIAlertView和UIAlertController或直接使用NSAppleScript
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.