NSAlert's icon not displayed when using default value

Viewed 1136

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

2 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.

Related