如何通过 xcode 从网站发送信息和接收信息

发布于 2024-12-04 07:05:46 字数 199 浏览 0 评论 0原文

如何在不“下载”文件一次然后使用它的情况下从网站发送信息和接收信息。就像,每次我按下按钮时,我都可以通过代码而不是 UIWebView 接收网站上的文本。

而且,如果我有一个文本字段,我可以输入一些文本,然后按下按钮,并以某种方式将该文本发送到网站。

有人能给我举个例子吗?

顺便说一句,对不起我的英语。如果您有不明白的地方,请告诉我。

How can i send information and receive information from a website without "downloading" the file once and then using it. Like, every time I push on a button, i could receive what the text on the website is trough the code, and not by UIWebView.

And also, if i have a textfield, i could type some text in and then push at a button, and send this text to the website, in some kind of way.

Could someone give me an example of this?

By the way, sorry for my english. Let me know if it was something you didn't understand.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

土豪我们做朋友吧 2024-12-11 07:05:46

NSString 有一个方法 + (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error ,您可以使用它以非常简单的方式抓取文本。要上传文本,您可以将 NSURLRequest 与 NSURLConnection 一起使用。

还有这个框架可以做你想做的事情:http://restkit.org/

NSString has a method + (id)stringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error that you can use for grabbing text in a very simple way. To upload the text you could use NSURLRequest together with NSURLConnection.

There are also this framework that might do stuff you'd like: http://restkit.org/

雨后彩虹 2024-12-11 07:05:46

您可以使用 NSURLConnection 从 HTML 请求中获取内容。您可以阅读Apple文档此处的 NSURLConnection

You can use NSURLConnection for grabbing stuff from HTML requests. You can read the Apple documentation on NSURLConnection here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文