Featured Apps

MyMemes

Create Your Own Memes
Add captions to the most popular meme images or your own photos

Sleepify

Music Alarm Clock
Simple, stylist and intuitive music alarm clock

Collaged

Create Photo Collages
Easily create photo collages to share with friends and family

Confirm Delete in OS X

20 May 2015

Objective-C
NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Delete the item?"];
[alert setInformativeText:@"Deleted item cannot be restored."];
[alert setAlertStyle:NSWarningAlertStyle];
if ([alert runModal] == NSAlertFirstButtonReturn) {
   //OK CLICKED, PROCEED
}