Ios – How to create a small Mac app that receives data over the WiFi network from an iOS app


What I need is to have a simple screen in this Mac app that just prints a string as the iPhone is transmitting strings through the WiFi network.

This string is simply a string value from a slider being adjusted up and down by the user on the iPhone. The data will be sent to the Mac app and then the Mac app will receive this signal from the WiFi network and simply print the values.

This is a constant connection. I'm not trying to sync once. I'm trying to listen to the iPhone device from the Mac to see if the iPhone is sending any more strings as the user slides the UISlider up and down from the iPhone app.

How can I create the client side? Do I need to use Bonjour or something?

Best Solution

In my answer to this question, I provide a link to a sample application that has a Mac component and an iPhone one. These components communicate between one another over a WiFi network, with changes in a label on one being reflected in the other. This is done using Bonjour discovery and the standard networking APIs.

With simple modifications, this could be used to send the continuous updates you need for your particular case.

Related Question