39,599 questions
-1
votes
0
answers
29
views
Mysterious error message: "Unable to obtain a task name port right for pid {_windowserver}: (os/kern) failure (0x5)" when calling newDocument() [closed]
I have recently restarted macOS Cocoa development, and I am running a M4 iMac with Tahoe 26.4.1, and using Xcode version 26.4.1 (17E202).
When my app starts, I get no error messages, but what triggers ...
0
votes
1
answer
55
views
How do I programmatically exit a custom [NSApp run] method?
As the title suggests, I have been working on a cross-platform project where I want to create apps for the macOS backend programmatically (without Xcode) through a combination of C and Objective-C, ...
Advice
0
votes
7
replies
98
views
How to show “Edit Extensions…” in NSSharingServicePicker menu on macOS?
I am working with the macOS sharing APIs, specifically NSSharingServicePicker, NSSharingServicePickerToolbarItem and related APIs.
When using the system share menu (for example in Safari or Notes), ...
0
votes
1
answer
103
views
How can I fix an NSRulerView in macOS 26 drawing into/conflicting with the window title bar?
When attaching a vertical ruler to a scroll view the separator is drawn all the way to the top of the window (macOS Tahoe):
Compare this to how it works in previous versions, such as macOS Sequoia (...
2
votes
0
answers
95
views
How to disable HDR drawing of NSImage
I have regular NSImage from iPhone and the drawing get's extremely choppy during window resize (especially at small window sizes below 100px). When the window size is large there is no problem with ...
4
votes
2
answers
141
views
How do I populate an NSMenuToolbarItem with Continuity Camera menu items?
In Apple apps like Mail and Notes, some NSMenuToolbarItem menus (e.g. Photo Browser, Media) include Continuity Camera actions under an Import from iPhone or iPad section (typically after a separator).
...
0
votes
0
answers
57
views
Why does macOS MultitouchSupport framework crash if MTDeviceStop is called immediately after MTUnregisterContactFrameCallback?
I'm using Apple's private MultitouchSupport.framework to receive raw trackpad touch data on macOS. The basic pattern is:
MTDeviceCreateList() / MTDeviceCreateDefault() to get device references
...
0
votes
1
answer
73
views
Does macOS require a .app bundle structure for menu bars to render, or can raw executables display menus?
I'm building a macOS calculator application in pure C using Cocoa via objc_msgSend without Objective-C syntax, and I've encountered conflicting information about menu bar rendering requirements.
What ...
1
vote
0
answers
132
views
Why does NSEvent.addGlobalMonitorForEvents still work in a Sandboxed macOS app
I am building a macOS utility using SwiftUI and Swift that records and displays keyboard shortcuts (like Cmd+C, Cmd+V) in the UI. To achieve this, I am using NSEvent.addGlobalMonitorForEvents(matching:...
3
votes
1
answer
153
views
How to draw tinted monochrome SF Symbol with AppKit
This is super easy with UIKit (imageWithTintColor:) but I need tinted monochrome NSImage in AppKit and no such equivalent exists. I know there is private method in AppKit -[NSImage ...
-1
votes
1
answer
87
views
NSScrollView starts scrolled down instead of showing top content on launch
I created a simple project where an NSScrollView contains a vertical NSStackView with several colored square NSView items.
However, when I build and run the app, it launches already scrolled down by ...
0
votes
0
answers
73
views
How to display SVG using QuickLookUI inside app?
I have old code that is capable of displaying every image but not the SVG. SVG can be displayed with QuickLook using Finder. However, I cannot replicate this in app. Quick note: NSImageView can ...
0
votes
0
answers
276
views
XCode 26.0.1, macOS 15.7, Objective-C/Cocoa UI Bindings issue
The console is filled with:
ViewBridge to RemoteViewService Terminated: Error Domain=com.apple.ViewBridge Code=18 "(null)" UserInfo={com.apple.ViewBridge.error.hint=this process disconnected ...
1
vote
1
answer
111
views
Get a Tk widget's associated CGContext
I've been working on a Tk widget that uses Cairo for more complex drawings as an extension to the standard Tk functions.
I've had great success on Windows and Linux, but not so much on MacOS. I need ...
-1
votes
1
answer
147
views
What is wrong with the following Objective-C/Cocoa book example?
I am learning Objective-C + Cocoa. According to a very outdated book (there are no newer ones like this one), I need to do the following:
Create the application.
Create a new Cocoa application named ...