How to display dialog box in OS X using Finder Sync Extension and Objective-C

690 Views Asked by At

I am creating a cocoa application with finder sync extension. I'm trying to open dialog box on some events of finder app.I am beginner for x code and objective c. I have tried the below code on some event..

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
    }

But this code is just for presenting alert box. Can anyone suggest me how do I get dialog box.

1

There are 1 best solutions below

1
Dass On

Try UIAlertView and UIAlertController or else simply use NSAppleScript