Is the开发者_运维技巧re a way to insert a custom icon in a NSAlert? I know you can have different prefabbealert styles but is it possible to cu
Yes. You can use
- (void)setIcon:(NSImage *)icon
Look at the documentation.
Swift:
let alert = NSAlert()
alert.messageText = "My message"
alert.addButton(withTitle: "OK")
alert.alertStyle = .informational
alert.icon = img
alert.runModal()
精彩评论