Post

Replies

Boosts

Views

Activity

Reply to macOS API for hardware model name?
I'm not sure if this counts as getting it "programmatically", but you can get this information using the command line tool system_profiler. (You can run a command line tool programmatically using the Swift class Process or the Objective-C class NSTask.) For instance if you parse the output of the command system_profiler -detailLevel mini -json and look for the key SPHardwareDataType, and within that machine_name, you'll find the friendly name. This will be the first part, like "MacBook Pro". The less friendly model name is under the key path SPHardwareDataType.machine_model. But I don't know how to get the user-friendly second part like "15-inch, 2018".
1w
Reply to Problem with event tap permission in Sequoia
@DTS Engineer I am a little confused by your mentions of LSUIElement=0 and LSUIElement=1 in your numbered list. Do you have them backward maybe? As I read the docs, the plist key LSUIElement has a boolean value, and the true value means that the app does not appear in the Dock, as in your case 2. So case 2 should say LSUIElement=1, right?
Jul ’24
Reply to How to debug over-release in Objective-C with ARC?
I've gotten rid of the assertion failure, but I can't say I understand how. I had code that retrieves a view pointer via a void* output parameter of a library function, like so: NSView* theView = nil; Q3Object_GetProperty( inDC, 'PWin', sizeof(void*), nullptr, &theView ); When I changed it to the following code, the error went away: NSView* theView = nil; void* rawViewPtr = nullptr; Q3Object_GetProperty( inDC, 'PWin', sizeof(void*), nullptr, &rawViewPtr ); theView = (__bridge NSView*) rawViewPtr;
Jul ’24
Reply to Problem with event tap permission in Sequoia
After more fooling around with deleting builds, deleting the copy from the App Store, and so forth, the problem no longer reproduces. So, that's good, I guess, but I'm not in the position of being able to file a useful bug report. But to answer your questions: The helper is an app bundle with LSBackgroundOnly set true in its Info.plist. I launch it using NSWorkspace. I granted permission to the helper, not the main app. Since the helper is background only, not a LSUIElement, I'm not sure that what you're saying there is relevant.
Jul ’24
Reply to How to do a postorder enumeration of a directory?
I tried it in Objective-C, and it does work, but it's not super obvious how it works. If you look up NSDirectoryEnumerationIncludesDirectoriesPostOrder in the header, comments say: NSDirectoryEnumerationIncludesDirectoriesPostOrder causes the NSDirectoryEnumerator to enumerate each directory a second time after all of its contained files have been enumerated. Use NSDirectoryEnumerator.isEnumeratingDirectoryPostOrder to differentiate a post-order enumerated directory from a pre-order one. What this means is that the enumerator visits a directory, then visits the contents of the directory, and then visits the directory again, and the second time, the isEnumeratingDirectoryPostOrder property of the enumerator is true. Maybe you should file a feedback about the documentation.
Jun ’24
Reply to Xcode won't symbolicate .ips crash log
Thanks for your reply, but I'm not actually asking for help in interpreting this particular crash log. As I indicated in my first post, I have already used the atos command line tool to figure out the symbols in my app involved in the crash. I was just wondering whether there is an easier way to handle future crash logs. The links you provided for symbolicating crash reports using Xcode does not appear relevant to Mac crashes. It says "click the Device Logs button in the Devices and Simulators window, then drag and drop the crash report file into the list of device logs", but I have nothing under Devices, and in particular no Device Logs button.
Jun ’24