macOS is the operating system for Mac.

Posts under macOS tag

200 Posts

Post

Replies

Boosts

Views

Activity

macOS WeatherKit "A server with the specified hostname could not be found"
My code was running with with the version before Xcode 26 RC. I recompiled one last time. Now I'm getting the error: A server with the specified hostname could not be found let now = Calendar.current.date(byAdding: .hour, value: 1, to: Date())! let nextWeek = Calendar.current.date(byAdding: .day, value: 14, to: Date())! do { let (dailyForecast, hourlyForecast, currentWeather, alertWeather) = try await weatherService.weather(for: thisLocation, including: .daily, .hourly(startDate: now, endDate: nextWeek), .current, .alerts) Suggestions?
4
1
139
Sep ’25
App Deleted itself after Freeze+ForceQuit on Tahoe 26.1B
I work on a MacBook Pro M3 Max 36GB RAM I am running macOS Tahoe Version 26.1 Beta (23B5042k) The last few days I had a couple of situations where Blender 4.5 LTS Froze and I had to forcequit, I noticed Blender would get Deleted with no notification after the forcequit, it was nowhere to be found on the Application List, Finder. Thought it was a blender issue because I run a special module with it. However around 30min ago I was using Mem and the App froze and I had to ForceQuit, The app also got removed, is not on the list of application and nowhere to be found however the icon on the dock which remained shows a Question Mark. I think this is an OS Behavior I just dont know what to attribute it to.
0
0
76
Sep ’25
Automatic menu translation ok with El Capitan, notok with Mojave
Hi everybody, I use a very old photo software called Snapseed v 1.2.1 on 2 MacBook, one runs with El Capitan and the second runs with Mojave. These app has no language selection during install, and no preferences language choice in menu when running. When I execute app on El Capitan, all menus and topics are translate in French, but on Mojave no translation is done. I looked Contents of app and found differents languages files (structured as xx.po where xx=country) located in Resources folder. I deduced translation was executed after getting language param. I checked values on both systems and there are same (LANG=fr_FR.UTF-8). So I tried to change Info.plist file to force code langage to 'fr' in CFBundleLocalizations key. Result is same. Does somebody has a idea of reason of issue and how to solve it ? Snapseed release was 2012, El Capitan 2015 and Mojave 2018, it seems framework used to code app runs differently and can't get language value.
2
0
74
Sep ’25
Looking for advice on app architecture
I have an existing Mac app which has evolved through over twenty years of development. It is currently written in a mixture of C++ and Objective-C, with a bit of C and Swift in a few places. For a few years now, I have been tinkering with replacing the UI with SwiftUI. The model has been completely rewritten in Swift and works fine. After a few tries, no version has been working acceptably, so I'm thinking that I need to rethink the architecture. The UI consists of a window with a master-detail view. The detail view is what users spend most of their time with. It contains a lot of subviews, around 100 typically. Keyboard events affect the display, so I've had a dedicated data structure to hold the state that is needed for displaying all the subviews. Using Instruments, I see that the view seems to recreate the subviews three times per keyboard event, so I'm clearly doing something wrong. A second factor is that there are a couple of dozen commands that are applicable to the detail view, driven either by menu items, keyboard shortcut, or toolbar button. Adding all of those to the view makes for a massive SwiftUI View, which seems unlikely to be good practice. The current implementation has the controller class broken up with categories, but still they are big classes. Most SwiftUI stuff on the web is iOS-oriented, and typically has a focus on fairly simple apps, so the whole topic of dealing with menu commands doesn't get a lot of coverage, so I've been doing all that through my own solutions, which are probably nothing like optimal. What I've been able to find is not particularly helpful for a full-fledged application like mine, so I'm looking for advice on how to structure the app. The existing one is largely MVC, but I've tried a similar approach and a shot at MVVM, but I'm not getting good results so far. So, pointers, places I can read more, or samples of real-world apps is what I'm after. Anyone?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
8
0
150
Sep ’25
Small Size Icons and NSToolbar on MacOS 12.0 Monterey -- can it work?
I noticing that Monterey defaults to the NSWindowToolbarStyleAutomatic / NSWindowToolbarStyleUnified toolbar style, which suppresses the "use Small Size" menu item and customization checkbox. So I've set the window to use NSWindowToolbarStyleExpanded. However, the toolbar will no longer change to a smaller icon size, as it did in MacOS 10.14, 10.15, and 11.0. I've tried to set the toolbar item sizing to "Automatic" for all of our toolbar icons, but that results in bad positioning in both Regular and Small Size mode -- the height is way too big. The native size of the icon .png files are 128 x 128. What's odd is that if I resize the window with the toolbar to be wider, the NSToolbarItems in the overflow area will be displayed in the toolbar are 128 x 128, where the rest of the toolbar icons get displayed as a 32 x 32 icon. The only way to get it to layout remotely correct is to make the NSToolbarItem to have an explicit minimum size of 24 x 24 and maximum size of 32 x 32. And that USED to allow "small size", but on Monterey, it no longer does. Anyone had any success with small size icons on Monterey?
Topic: UI Frameworks SubTopic: AppKit Tags:
1
2
1.2k
Sep ’25
Guidance on Blocking Screenshots/Screen Recordings in macOS App (Unity 6000.0.51f1)
Dear Team, We have developed a macOS app using Unity (6000.0.51f1) that includes learning activities, assessments/tests, audio recording, and video playback functionalities. For security and content protection, we want to restrict the ability for users to capture screenshots or screen recordings of the app (especially via the built-in Cmd+Shift+5 / Screenshot toolbar). We have attempted several approaches, but they have not been reliable. We would appreciate guidance from Apple or the developer community on the feasibility of this requirement. Our requirements: Block or disable screenshots/screen recordings (particularly the built-in Cmd+Shift+5) for the app. Preferably achieve this using public APIs so that the app remains App Store compatible and passes review. If full blocking is not possible, then at least ensure that any captured content appears blank/black for sensitive sections of the app. Additionally, we would like our app’s window behavior to work like other apps do: Red button → Close the application completely. Yellow button → Minimize the application to the Dock. Green button → Maximize to full screen while still allowing access to the Dock and menu bar. Any advice, best practices, or references to relevant documentation would be highly valuable. Thank you for your support.
1
0
108
Sep ’25
VPN Split DNS behaviour
I encountered an undesired DNS behaviour when using L2TP/ipsec VPN. I have DHCP configured Wi-Fi connection, which send dns servers and search domain (192.168.0.10, lan) VPN sends its own DNS server (10.0.0.2), search domain (intranet) is added manually in VPN DNS config settings. I expect, when VPN is connected, to be still able to resolve local names, i.e some-host.lan. However, they become unresolvable. quick check shows that the remote dns server is used to resolve local names. shilishper@mac ~ % host -v some-host.lan Trying "some-host.lan" Host some-host.lan not found: 3(NXDOMAIN) Received 106 bytes from 10.0.0.2#53 in 16 ms Received 106 bytes from 10.0.0.2#53 in 16 ms Actually, all dns queries are going to the remote server. I would expect that only queries for the configured domain (intranet) should go to that server. I played with the service order, but it didn't change anything. Is anything can be done about this, programmatically? PS new to macOS, but have extensive linux knowledge
2
0
112
Sep ’25
CoreData CloudKit Sync not working between iOs and MacOS
Hi All, I work on a cross platform app, iOS/macOS. All devises on iOS could synchronize data from Coredata : I create a client, I see him an all iOS devices. But when I test on macOs (with TestFlight) the Mac app could not get any information from iOs devices. On Mac, cloud drive is working because I could download and upload documents and share it between all devices, so the account is working but with my App on MacOS, there is no synchronisation. idea????
2
0
1.2k
Sep ’25
Approach Used To Create Song List As In Example
Hi, I am looking for guidance on how to create a scrollable song list, such as the attachment. The song list was originally created in C#, using an RTF object and populated by about 43 lines of song criteria. What similar approach would I use in Swift and MacOS? By the way, I currently play music that resides on the Mac, no external streaming is required or desired. Thanks, Jim
0
0
131
Sep ’25
URL.bookmarkData(): File descriptor doesn't match the real path
I'm having a problem on macOS 26 that has not happened on previous macOS versions. When I call guard url.startAccessingSecurityScopedResource() else { return } try url.bookmarkData(options: [.withSecurityScope]) with url being "file:///", I get an error Error Domain=NSCocoaErrorDomain Code=256 "File descriptor doesn't match the real path." Given that Google returns 0 results on this error, I suppose this is a macOS 26 novelty. (The bookmark data created before upgrading to 26 resolve well). Does anyone already met this or have an idea on how to get around it? The app is a file manager, so having bookmarked access to "/" is crucial.
1
0
152
Sep ’25
macos 15.6.1 - BSD sendto() fails for IPv4-mapped IPv6 addresses
There appears to be some unexplained change in behaviour in the recent version of macos 15.6.1 which is causing the BSD socket sendto() syscall to no longer send the data when the source socket is bound to a IPv4-mapped IPv6 address. I have attached a trivial native code which reproduces the issue. What this reproducer does is explained as a comment on that code's main() function: // Creates a AF_INET6 datagram socket, marks it as dual socket (i.e. IPV6_V6ONLY = 0), // then binds the socket to a IPv4-mapped IPv6 address (chosen on the host where this test runs). // // The test then uses sendto() to send some bytes. For the sake of this test, it uses the same IPv4-mapped // IPv6 address as the destination address to sendto(). The test then waits for (a maximum of) 15 seconds to // receive that sent message by calling recvfrom(). // // The test passes on macos (x64 and aarch64) hosts of versions 12.x, 13.x, 14.x and 15.x upto 15.5. // Only on macos 15.6.1 and the recent macos 26, the test fails. Specifically, the first message that is // sent using sendto() is never sent (and thus the recvfrom()) times out. sendto() however returns 0, // incorrectly indicating a successful send. Interesting, if you repeat sendto() a second message from the // same bound socket to the exact same destination address, the send message is indeed correctly sent and // received immediately by the recvfrom(). It's only the first message which goes missing (the test uses // unique content in each message to be sure which exact message was received and it has been observed that // only the second message is received and the first one lost). // // Logs collected using "sudo log collect --last 2m" (after the test program returns) shows the following log // message, which seem relevant: // ... // default kernel cfil_hash_entry_log:6088 <CFIL: Error: sosend_reinject() failed>: // [86868 a.out] <UDP(17) out so 59faaa5dbbcef55d 127846646561221313 127846646561221313 age 0> // lport 65051 fport 65051 laddr 192.168.1.2 faddr 192.168.1.2 hash 201AAC1 // default kernel cfil_service_inject_queue:4472 CFIL: sosend() failed 22 // ... // As noted, this test passes without issues on various macosx version (12 through 15.5), both x64 and aarch64 but always fails against 15.6.1. I have been told that it also fails on the recently released macos 26 but I don't have access to such host to verify it myself. The release notes don't usually contain this level of detail, so it's hard to tell if something changed intentionally or if this is a bug. Should I report this through the feedback assistant? Attached is the source of the reproducer, run it as: clang dgramsend.c ./a.out On macos 15.6.1, you will see that it will fail to send (and thus receive) the message on first attempt but the second one passes: ... created and bound a datagram dual socket to ::ffff:192.168.1.2:65055 ::ffff:192.168.1.2:65055 sendto() ::ffff:192.168.1.2:65055 ---- Attempt 1 ---- sending greeting "hello 1" sendto() succeeded, sent 8 bytes calling recvfrom() receive timed out --------------------- ---- Attempt 2 ---- sending greeting "hello 2" sendto() succeeded, sent 8 bytes calling recvfrom() received 8 bytes: "hello 2" --------------------- TEST FAILED ... The output "log collect --last 2m" contains a related error (and this log message consistently shows up every time you run that reproducer): ... default kernel cfil_hash_entry_log:6088 <CFIL: Error: sosend_reinject() failed>: [86248 a.out] <UDP(17) out so 59faaa5dbbcef55d 127846646561221313 127846646561221313 age 0> lport 65055 fport 65055 laddr 192.168.1.2 faddr 192.168.1.2 hash 201AAC1 default kernel cfil_service_inject_queue:4472 CFIL: sosend() failed 22 ... I don't know what it means though. dgramsend.c
2
0
198
Sep ’25
Using MetricKit for Hangs on macOS
Hallo all, I did a test integration of MetricKit into one of our apps...I'am on macOS Ventura 13.3.1 (a). The app is not distributed via the App Store. I subscribed to the MXMetricManager and implemented the didReceiveDiagnosticPayloads function. So far everything seems to work, when I use in Xcode: Debug -> Simulate MetricKit Payload I get a callback and the payload. So I did some further testing. When I build the app debug version with a test crash and then run the Debug Version (without Xcode) and let it crash the next time I start the app I get a callback to didReceiveDiagnosticPayloads with all the information about the crash. But I'am not able to get a hang report. I tested it by adding a sleep (60) and adding some intensive computation work on the main thread so that it is busy for several seconds, I get no hang reports :-( I'am using the Debug version and run it without Xcode. Are hang reports expected to be reported immediately? I also get after 24 hours no hang reports. Can someone help me? Thanks and have a nice day!
2
1
1.2k
Sep ’25
How to update Endpoint Security Extension?
Hi, I’m expecting the demo from Apple, but I think I’m seeing different behavior on my end. Here are the steps I followed: Run the SampleEndpointApp example. Copy SampleEndpointApp to the /Applications folder. Run and enable the Extension and Full Disk Access → Everything works properly. I modify something in the example and start again from step #1, but nothing gets updated as shown in the demo video. The only way I can make it work is by going into Settings, manually removing the ES extension, and then running the app again. My concern is: if I deliver the application to clients, how can I properly update the extension without requiring them to manually remove it first? Thanks,
1
0
127
Sep ’25
Spotlight App Extension does not persist custom Attributes
We are in the process of updating our legacy Spotlight MDImporter to the new macOS Spotlight App Extension. The transition works well for standard attributes such as title, textContent, and keywords. However, we encounter an issue when adding custom attributes to the CSSearchableItemAttributeSet. These custom attributes are not being persisted, which means they cannot be queried using a Spotlight NSMetadataQuery. Has anyone an idea on how to append custom attributes so that they are included in the indexed file status, as displayed by the shell command mdimport -t -d3 <path> A sample project illustrating the problem is available here: https://www.dropbox.com/scl/fi/t8qg51cr1rpwouxdl900b/2024-09-04-Spotlight-extAttr.zip?rlkey=lg6n9060snw7mrz6jsxfdlnfa&dl=1
2
0
537
Sep ’25
Keep getting an error on macOS when trying to use Passkeys to login
I keep getting the following error when trying to run Passkey sign in on macOS. Told not to present authorization sheet: Error Domain=com.apple.AuthenticationServicesCore.AuthorizationError Code=1 "(null)" ASAuthorizationController credential request failed with error: Error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1004 "(null)" This is the specific error. Application with identifier a is not associated with domain b I have config the apple-app-site-association link and use ?mode=developer Could there be any reason for this?
0
0
198
Sep ’25
A few questions about allowed-os-versions and os-version in Distribution Definition files
In the archived documentation for Distribution Definition files (https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html), the allowed-os-versions and os-version element are partially documented. I have a few questions about these elements: allowed-os-versions The documentation states: Availability: Available in OS X v10.6.6 and later. Has this element always worked correctly in the past? I'm asking because it does not seem to work correctly on OS X v10.14 for the min attribute of a sub os-version element. os-version The documentation states: This element is designed for you to use a specific OS version number for the min attribute, and a major OS version number for the before attribute. The expectation is that you will know an exact minimum version but not an exact major version. This keeps you from having to guess the last minor revision before the next major revision, as you would have to do if the before attribute were inclusive. This is quite confusing because the documentation never explicitly says what a specific or major OS version number is. Is specific major.minor.patch or major.minor? What is major? major or major.minor? As the documentation was created at a time where the OS version scheme was: 10.minor.patch (and minor was actually the major) and we are now in an era where the OS version is major.minor.path, this is even more confusing. I would also be curious to know what the major version is officially supposed to be for macOS Tahoe in this case. 16 or 26? Generally speaking, this documentation is missing examples for a lot of the elements. Also why is there a tag for InstallerJS and not one for Installation in the Developer Forums?
2
0
117
Sep ’25