NSAlert runModal black window


Marco S Hyman
 

Has NSAlert changed recently? Looking at the documentation I see that the only initializer (swift) is `init(error: Error)` yet my code never passes an error. Is the Error argument new?

But my issue is this:

// put up an alert
let alert = NSAlert()
alert.alertStyle = NSAlert.Style.informational
alert.addButton(withTitle: NSLocalizedString("CLOSE", comment: "Close"))
alert.messageText = NSLocalizedString("GPX_LOADED_TITLE", comment: "GPX file loaded")
alert.informativeText = url.path
alert.informativeText += NSLocalizedString("GPX_LOADED_DESC", comment: "GPX file loaded")
alert.runModal()

Sometimes it works. Other times I get a black window with only the app icon and the close button showing. This is a new issue, first noted while testing with Xcode 10.0 running on Mojave. I am not using the dark appearance.

Marc

Join {cocoa@apple-dev.groups.io to automatically receive all group messages.