Communication between iPhone & MacBook

Discussion in 'iOS Programming' started by MikeDimitri, May 2, 2011.

  1. MikeDimitri macrumors newbie

    May 2, 2011

    I want to have 1 program running on my phone/simulator that has a slider and a button, and another receiving program on the mac, such as Processing/Supercollider.

    When the button is pressed I want a string to be returned in the post window on the mac program, such as 'Hello'. When the slider is moved up/down I want a variable integer (0-100) to be returned on the mac corresponding with the movement of the slider.

    I'm assuming a WiFi connection would be essential for the sending of messages between devices - CFSocket or NSStream seem to be the sort of thing I would need but I'm struggling to impliment these in xCode

    If anyone could provide any useful tutorials/links/source code this would be much appreciated.

  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    Sounds like something you could implement with an HTML page, a slider control, and some JavaScript. The MacBook acts as an HTTP server. The page loads from the MacBook to the iPhone using Safari on the phone.

    Put the page on the MacBook and turn on Web Sharing in the Sharing panel of System Preferences. Write the JavaScript to send XMLHttpRequests to a PHP or perl script residing on the MacBook. Or just install MAMP on your MacBook and use that.

    Since this is effectively your first post (you asked the same question in the wrong forum), please summarize your programming experience and skills, so we know how to frame a more specific answer.

Share This Page