Posts

Post marked as solved
12 Replies
1.8k Views
I'm trying to write a game for MacOS and I'd like to be able to provide a menu option, when the app isn't running, that allows them to jump straight back to the last game level they were playing. My limited understanding is that NSDockTilePlugins is the correct way to do this, as from MacOS 10.6, but I cannot find an actual Objective C tutorial from Apple on how to implement this correctly?Is this the only way to implement non-runtime menus? Can anyone please point me in the right direction?
Posted
by domaal.
Last updated
.
Post not yet marked as solved
4 Replies
2.3k Views
Firstly let me start by saying I'm totally new to using IOKit and fairly new to Swift. That said, I've successfully managed to detect the insertion and removal of my USB serial device in my Swift, MacOS app. Therefore calling ls /dev/tty.* lists the same devices as via the IOServiceAddMatchingNotification(notifyPort, kIOFirstMatchNotification, IOServiceMatching("IOSerialBSDClient"), matchingCallback, selfPtr, &matchedIterator) call inside the resulting callback. This is a great start. As you can imagine telling the user you've found "/dev/tty.usbmodem[some number]" isn't particularly user friendly. So once I retrieve the IODialinDevice property from the aforementioned callback is there a way for me to lookup the USB device's Vendor ID and Product ID and ideally retrieve the human readable name for said USB device, so I can then expose that to the User? Thanks.
Posted
by domaal.
Last updated
.
Post marked as solved
3 Replies
1.2k Views
I'm currently working with IOKit on Mac (I'm new to it, but managed to get a Serial USB demo working) and noticed that it says that IOKit is Mac Catalyst 13.0+ compatible. But when I import IOKit into my iOS Swift project. I'm getting a No such module 'IOKit' error. Do I have to manually add this framework? I read somewhere that IOKit access may not be possible on iOS/iPad devices, if I released my app on the App Store, but what about internal home or company iOS devices, that won't ever be released on the App Store?? Thanks.
Posted
by domaal.
Last updated
.
Post not yet marked as solved
3 Replies
675 Views
I ask because it seems BNDLs can have executable code, the same as APPLs. So wondering when one should put executable code into a BNDL and when you shouldn't?
Posted
by domaal.
Last updated
.
Post marked as solved
6 Replies
809 Views
I have a custom NSTabViewController displayed from within an NSPopOver and as you can see from the image below, the NSTabViewItems contain custom NSButtons. My issue is that in order to support the latest Accessibility requirements, I would like to have the a specific tab have keyboard focus. Setting InitialFirstResponder does not work. Nor does calling MakeFirstResponder within ViewDidAppear, the normal way. The hack that works for me is within the NSTabViewController's ViewDidAppear override, I do a 250ms delay, on a background thread, and then call MakeFirstResponder on the NSButton I want focus on.This works as desired, but I'm not fond of hacks, so I'm looking for a more elegant and presumably more correct solution. I'm new to MacOS dev, so looking for the best practice solution, if there is one.
Posted
by domaal.
Last updated
.