Post

Replies

Boosts

Views

Activity

Does Mac Catalyst support Background Processing?
I have an app for macOS that is built using Mac Catalyst. I need to perform some background processing. I'm using BGProcessingTaskRequest to schedule the request. I have also integrated CKSyncEngine so I need that to be able to perform its normal background processing. On iOS, when the user leaves the app, I can see a log message that the request was scheduled and a bit later I see log messages coming from the actual background task code. On macOS I ran the app from Xcode. I then quit the app (Cmd-q). I can see the log message that the request was scheduled. But the actual task is never run. In my test, I ran my app on a MacBook Pro running macOS 26.0. When I quit the app, I checked the log file in the app sandbox and saw the message that the task was scheduled. About 20 minutes later I closed the lid on the MacBook Pro for the night. I did not power down, it just went to sleep. Roughly 10 hours later I opened the lid on the MacBook Pro, logged in, and checked the log file. It had not been updated since quitting the app. I should also mention that the laptop was not plugged in at all during this period. My question is, does a Mac Catalyst app support background processing after the user quits the app? If so, how is it enabled? The documentation for BGProcessingTaskRequest and BGProcessingTask show they are supported under Mac Catalyst, but I couldn't find any documentation in the Background Tasks section that mentioned anything specific to setup for Mac Catalyst. Running the Settings app and going to General -> Login Items & Extension, I do not see my app under the App Background Activity section. Does it need to be listed there? If so, what steps are needed to get it there? If this is all documented somewhere, I'd appreciate a link since I was not able to find anything specific to making this work under Mac Catalyst.
4
1
121
3w
Shortcut to wrap selected lines in a #if/#endif
I'm looking for a way to make the following possible in Xcode (26.0 or later): I select one or more lines of code. I then enter a hotkey (or select a menu item) that results in adding the line: #ifdef SOME_MACRO before the selection and adding the line: #endif after the selection. Example: Start with the following lines of code: BOOL x = NO; int y = 4; NSString *str = @"Hello"; If I then highlight the int y = 4; line and use the proper hotkey or menu, the result would be: BOOL x = NO; #ifdef SOME_MACRO int y = 4; #endif NSString *str = @"Hello"; Is something like this possible in Xcode? I looked at code snippets but that doesn't seem to support wrapping existing code. I looked at the Xcode Settings under Editor and Shortcuts and didn't see a way to add such a custom shortcut.
0
0
29
1w