I've developed two apps which communicate between each other using IPC. Here is a code of server and client sides:
Server:
_distantObject = [[DistantObject alloc] init];
NSPort *serverPort = [NSMachPort port];
_proxyConnection = [[NSConnection alloc] initWithReceivePort:serverPort sendPort:serverPort];
[_proxyConnection setRootObject:_distantObject];
if (![_proxyConnection registerName:@"MyServer"]) {
NSLog(@"ERROR: starting MyServer");
}
Client:
DistantObject *remoteObject;
NSConnection *theConnection = [NSConnection connectionWithRegisteredName:@"MyServer"
host:nil];
if (theConnection != nil) {
remoteObject = (DistantObject *)[theConnection rootProxy];
remoteObject.someValue = value;
}
The problem is that it doesn't work on OS X 10.6. But works perfectly on 10.7, 10.8 and 10.9. Here is an errors I receive on 10.6:
__NSAutoreleaseNoPool(): Object 0x10031a0f0 of class NSCFDictionary autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x100330b50 of class NSCFArray autoreleased with no pool in place - just leaking
As result client doesn't pass appropriated value.