Let’s say I have two Cocoa apps running on the same machine (OSX). Is there a way to send “objective c” messages from one to objects in the other one?
These two apps need to remain independent, so they can be started and stopped by the user independently or users can have only one of the two on their machines. I know the best solution maybe using Sockets or pipes, but I wanted to know if I am not instantiating an object is there a way to send it a message (or call its methods) in anyway? I understand that the receiver may just ignore the messages or does whatever it wants with them.
Let’s say I have two Cocoa apps running on the same machine (OSX). Is
Share
What you are looking for is distributed objects. It allows you to broadcast an object from one application or thread so that other applications or threads can find it and communicate with it. Each application or thread using it will create a proxy object which it can send messages to, and those messages are forwarded to the actual object. Unfortunately, Apple seems to have removed its guide for distributed objects, but here is a GNUstep tutorial as well as the GNUstep manual to help you out. You will also want to look at the NSConnection class reference.