To receive some notifications (for instance, CGDisplayRegisterReconfigurationCallback) from my launch daemon (written in C++ for macOS) I need to call ...
To receive some notifications (for instance, CGDisplayRegisterReconfigurationCallback) from my launch daemon (written in C++ for macOS) I need to call ...
I want my Vapor app to be able to create and show NSWindows on the host machine. For this I've edited main.swift like this: So Vapor runs in a sepa ...
I am working on a widget for my existing Mac app. The problem I am running into is that when I add a Link from the widget to the main app, the method ...
I'm using the following code to add a new menu item programatically But this does not add a new menu item. ...
Are both of this snippets the same? Is it possible that on the first one myClass can at some point in the lifetime of the application will be eliminat ...
I'm trying to get a mac app to open on the current desktop when I use a a global keyboard shortcut (that I've overriden manually in the app). However, ...
You can use following code to bring your app window to focus when a specific event was triggered, e.g. a global hotkey was pressed or a tea timer has ...
Here is a minimal reproductible example, if too long to read, go to next section with the problem, and then explore the code if needed. Minimal examp ...
Many people appear to have a problem where their AppDelegate's applicationShouldTerminate is never called. I have the opposite problem! Often (at a g ...
When run my app(OSX, macOS SDK 10.15), it shows the main window, as expected. I then CMD-Tab to another app, but when I CMD-Tab back to my app, it won ...
I have an NSTextField in my window and 4 menu items with key equivalents ←↑→↓. When the text field is selected and I press an arrow key, I would expe ...
I have a MacOS app that is a registered custom URL handler. I'm trying to make it show a specific NSViewController if the app is started via the url h ...
I'm trying to make a simple macOS Cocoa application using NSStatusItem to create a clickable icon on the system status bar. However, when I launch my ...
I want to do some stuff when an application terminates, so I added applicationShouldTerminate: and applicationWillTerminate methods to my AppDelegate. ...
I have a Cocoa app that presents a folder structure to the user and allows basic file system operations such as move/copy/rename. I perform all fil ...
I have a basic NSDocument-based app. I need to make one last change to the document when: The user closes the document's window The user termina ...
Is there any way for a Cocoa application to detect when the user has tried to quit it via its Dock menu, and not by some other method? Normally it's ...
I'm trying to write a small utility that attaches itself to the current main/key window. I've managed to make sure that the window cannot become key o ...
I'm writing a document-based application for Mac in Swift 4, which, according to my client needs, has to show a licensing window were the user will pr ...
I am looking to create a menu sidebar in my application which can display and control view controllers besides the menu. Something like the following: ...