how to send data from iphone over wifi to application, to print message

前端 未结 2 1172
长发绾君心
长发绾君心 2021-01-31 12:15

i would like to know how to do the following:

step 1: how to send the following string from the iphone to a mac computer via WIFI when a user presses a

2条回答
  •  既然无缘
    2021-01-31 13:11

    I'll quote myself from a similar question:

    How can I create a small Mac app that receives data over the WiFi network from an iOS app?

    Using 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-iphone

提交回复
热议问题