views:

69

answers:

2

Hi, this is the first time i am creating a mac application, what i need to do is to have a simple screen. This simple plain screen will just print a string as the iphone is transmitting strings through the wifi network.

This string is simply a string value of the slider being adjusted by the user as they move it up and down. so it will string values like so "1" "2" "3" and so on as the user is sliding the slider up. 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.

How can i create the client side? do i need to use bonjour or something?

remember its a constant connection. im not trying to sync once. im 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

Thanks in advance

A: 

Use the CFNetwork framework, you can use bonjour for discovery and then handle a persistent connection through native sockets for passing data back and forth.

http://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/Introduction/Introduction.html

Here is an excellent tutorial to get started, its for iOS but CFNetwork is available in OS X too.

http://mobileorchard.com/tutorial-networking-and-bonjour-on-ip

Ben
A: 

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.

Brad Larson