I have a Helper Tool, running as root, started via SMJobBless and communicating vie Xpc.
Works fine, but: 1. it cannot stop (CFRunLoopStop), 2. Timers never fire 3. NSRunLoop currentMode returns nil. Maybe all three things are related. To 1: if ( asked to quit ) { NSRunLoop *currentRunLoop = [ NSRunLoop currentRunLoop ]; CFRunLoopRef rl = [ currentRunLoop getCFRunLoop ]; NSLog(@"%s will stop runloop %p",__FUNCTION__, rl); // rl ≠ NULL CFRunLoopStop ( rl ); // runLoop will NOT stop } Helper Tool main: int main(int argc, const char * argv[]) { @autoreleasepool { NSString * bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName: bundleIdentifier ]; listener.delegate = ...; [listener resume]; NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; [ currentRunLoop run ]; } return EXIT_SUCCESS; } _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com