user2496245
user2496245

Reputation: 53

Pop-up message on macOS programming

Like using UIAlertView on iOS. There should be a similar solution for creating a pop-up message on macOS. Tried to search but could not find anything useful.

Upvotes: 3

Views: 2018

Answers (1)

Mick MacCallum
Mick MacCallum

Reputation: 130183

The class you're looking for is NSAlert. Information on this class can be found in its class reference here. And here is an example of its usage:

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

[alert setMessageText:@"Some awesome message text"];
[alert addButtonWithTitle:@"OK"];
[alert runModal];

Upvotes: 2

Related Questions