Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSAlert's icon not displayed when using default value

According to documentation doing:

let alert = NSAlert() 
alert.icon = nil
alert.runModally()

should render application's icon. But I get placeholder instead.

enter image description here

like image 457
zuziaka Avatar asked Jul 16 '26 23:07

zuziaka


1 Answers

Was just having this same problem. Initially I had only a 256@1x icon and got no icon in the alert. Once I added a 128@1x icon to the AppIcon resource however, the NSAlert displayed it properly.

And no, you don't need to explicitly set the icon to nil.

like image 70
gmw Avatar answered Jul 18 '26 13:07

gmw



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!