Software Development

For my freeware app SiriMote (which lets you control your Mac and its apps with your Apple TV Remote), I created a code-drawn representation of Apple TV’s Siri Remote (versions 2015-2021).

I figured, sharing is caring, so here you go, you can get at it over on GitHub.

It’s written in Objective-C, was built with Xcode 12.5.1 and runs on macOS 10.12.2 and newer.

Enjoy šŸ˜Š

Read more

Yesterday, I was working on Transloader v3.0. In particular, on its push notifications and making sure everything syncs properly.
Today, I wanted to continue working on this, but found myself unable to. My Mac suddenly didnā€™t receive CloudKit push notifications anymore.
Even worse, neither of the delegate methods

- (void)application:(NSApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken

and

- (void)application:(NSApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error

werenā€™t called anymore – without any code changes. Something was wrong.

But here we are, a couple of hours later, and everythingā€™s working again. Finally.
So, to save you some time should this happen to you, hereā€™s what I did:

Restart

I restarted my Mac – the obvious solution. You might think. Only that it didnā€™t work, the problem persisted. But itā€™s still the first thing Iā€™ll try if this returns.

Delete Containers, Group Containers, and CloudKit Caches

In Finder, delete

/Users/yourname/Library/Containers/yourAppContainerFolder/
/Users/yourname/Library/Group Containers/yourGroupID.yourAppGroupContainerFolder/
/Users/yourname/Library/Caches/CloudKit/yourAppID
/Users/yourname/Library/Caches/CloudKit/CloudKitMetadata* (*all files that begin with that filename)
/Users/yourname/Library/Caches/CloudKit/CloudKitOperationInfo* (*all files that begin with that filename)

Now launch Activity Monitor.app and force quit the following processes:

cfprefsd
apsd
notifyd
remoted

Now, Iā€™m not sure you need to force-quit each and every one of those, but I wanted to relaunch any process that remotely looked like it had to do with remote/push notifications.

At this point, I restarted Transloader through Xcode, and lo and behold, it worked again.
On my MacBook Pro, where the same problem occurred simultaneously, I took the same steps. And it *didnā€™t* work. A restart was required, so your mileage – like mine – may vary.

Additional Info

Thereā€™s also this handy technical note from Apple, which can help debugging push notifications on both macOS and iOS.

Read more

For Transloaderā€™s upcoming version 3.0, I needed an NSMenuItem that not only showed a title, but also a subtitle, along with an optional image.

Because it took a bit of work and ā€œreverse-engineeringā€ (the click-on-an-item-selection-animationā€™s timing, in particular), I figured someone else might benefit from this.

Where to get it / Sample Project

Itā€™s all pretty straight forward, and best shown / explained as an Xcode project, which you can download on Github.
This is basically all you need to do:

Screenshot the sample project's source code

Thatā€™s it!

Caveats

There are some things this implementation can not do, which the default NSMenuItem can:

  • There is no type select
  • The arrow keys canā€™t be used to go through the items
  • You canā€™t activate items with the space or enter keys

Basically, keyboard interaction is unavailable.

I do hope itā€™s useful to you anyways.
If youā€™re using this, Iā€™d love to hear from you! šŸ˜Š

Read more