简体   繁体   English

iPhone基本图+套接字通信

[英]iPhone Basic Drawing + Socket communication

I took upon myself to create an App that allows the user to draw and as he draws the strokes would be sent to a server via a Socket connection. 我亲自创建了一个应用程序,该应用程序允许用户进行绘制,并且在他进行绘制时,笔划将通过套接字连接发送到服务器。 The app also needs to receive strokes and display them as well. 该应用程序还需要接收笔画并显示它们。

This would be just a demo app for our server, not a serious iPhone app. 这只是我们服务器的演示应用程序,不是认真的iPhone应用程序。

Any ideas, suggestions would be AWESOME. 任何想法,建议都很棒。

I started with this great tutorial: http://icodeblog.com/2008/07/30/iphone-programming-tutorial-connecting-code-to-an-interface-builder-view/ but it took me two days to just get the Hello World up and running :( 我从这个很棒的教程开始: http : //icodeblog.com/2008/07/30/iphone-programming-tutorial-connecting-code-to-an-interface-builder-view/,但花了我两天时间Hello World启动并运行:(

One simple solution would be to render the content in a UIWebView , and let it download the strokes and display them in eg a HTML Canvas. 一种简单的解决方案是将内容呈现在UIWebView中 ,然后让其下载笔画并在HTML Canvas中显示它们。 Interaction could then be done in a relatively platform-independent manner using eg AJAX. 然后可以使用例如AJAX以相对独立于平台的方式进行交互。 The iPhone version of Safari is a very capable browser. iPhone版本的Safari是功能非常强大的浏览器。 If you are familiar with these technologies that would probably be the easiest solution. 如果您熟悉这些技术,那可能是最简单的解决方案。

If you want to roll your own component, maybe using a more high-level protocol like XML-RPC or plain HTTP would be easier than raw sockets? 如果要滚动自己的组件,也许使用比XML-RPC纯HTTP等更高级的协议比原始套接字更容易?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM