Skip to content

Instantly share code, notes, and snippets.

@tommetge
Created October 21, 2013 17:55
Show Gist options
  • Save tommetge/7088091 to your computer and use it in GitHub Desktop.
Save tommetge/7088091 to your computer and use it in GitHub Desktop.
launch_data_t req = launch_data_new_string(LAUNCH_KEY_CHECKIN);
launch_data_t resp = launch_msg(req);
launch_data_t machData =
launch_data_dict_lookup(resp, LAUNCH_JOBKEY_MACHSERVICES);
launch_data_t machPortData =
launch_data_dict_lookup(machData, "com.company.helper.mach");
mach_port_t mp = launch_data_get_machport(machPortData);
launch_data_free(req);
launch_data_free(resp);
NSMachPort *rp = [[NSMachPort alloc] initWithMachPort:mp];
NSConnection *c = [NSConnection connectionWithReceivePort:rp
sendPort:nil];
[rp release];
DistributedObje t obj = [[DistributedObject alloc] init];
[c setRootObject:obj];
[obj release];
@try {
[[NSRunLoop currentRunLoop] run];
}
@catch (NSException *exception) {
NSLog(@"Exception processing request: %@", exception);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment