Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pop-up message on macOS programming

Tags:

xcode

macos

popup

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.

like image 840
user2496245 Avatar asked Feb 06 '26 20:02

user2496245


1 Answers

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];
like image 90
Mick MacCallum Avatar answered Feb 09 '26 01:02

Mick MacCallum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!