My helper agent app needs to constantly perform one activity after its launch, but it also needs to communicate via XPC, to the main app
However, the setup of the listener requires a specific main function, and that takes over the app (omitting the standard AppDelegate NSApplication approach)
int main(int argc, const char *argv[])
{
NSString *bundleId = [[NSBundle mainBundle] bundleIdentifier];
NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:bundleId];
XX *xx = [XX new];
listener.delegate = xx;
[listener resume];
return 0;
}
How to have both? Background app with NSRunLoop and NSXPCListener app?