Sending a Message from a iPhone to a Mac
How would I send a message to an App on my mac (which I develop) from my iPhone via WiFi? This message would then make something happen in the Mac A开发者_JAVA技巧pp.
This is just a fun app for myself so it doesn't need any security like SSL.
I'd recommend looking into a tutorial on Bonjour.
http://www.mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/
http://www.macresearch.org/cocoa-scientists-part-xxviii-bonjour-and-how-do-you-do
Use TCP to create a connection. Here's a tutorial: http://dev.im.ethz.ch/wiki/Socket_communication_on_the_iPhone
But TCP is extremely common protocol, so on the Mac side you can probably just read up on TCP sockets and be fine.
精彩评论