你的位置:首页 > 软件开发 > 操作系统 > iOS Programming Web Services and UIWebView

iOS Programming Web Services and UIWebView

发布时间:2015-05-22 00:00:04
iOS Programming Web Services and UIWebView The work is divided into two parts. The first is connecting to and collecting data from a web s ...

iOS Programming Web Services and UIWebView

iOS Programming Web Services and UIWebView

The work is divided into two parts. The first is connecting to and collecting data from a web service and using that data to create model objects. The second part is using the UIWebView class to display web content.

工作分为两部分,第一,连接和手机数据从一个web service 并使用这些数据创建model objects。第二部分是使用UIWebView 类展示web content .

Nerdfeed object diagram

iOS Programming Web Services and UIWebView

1 Web Services

Your web browser uses the HTTP protocol to communicate with a web server.

你的web 浏览器通过HTTP协议与一个web server 交流。

In the simplest interaction, the browser sends a request to the server specifying a URL.

最简单的方式是浏览器发送一个请求到指定url 的服务器。

The server responds by sending back the requested page (typically HTML and images), which the browser formats and displays.

浏览器响应通过返回给请求的页面浏览器的格式和显示。

In more complex interactions, browser requests include other parameters, like form data. The server processes these parameters and returns a customized, or dynamic, web page.

You can write a client application for iOS that leverages the HTTP infrastructure to talk to a web- enabled server. The server side of this application is a web service. Your client application and the web service can exchange requests and responses via HTTP.

Because the HTTP protocol does not care what data it transports, these exchanges can contain complex data.

因为HTTP protocol不关心它传送的数据是什么,这些exchanges 可能包含复杂的数据。

This data is typically in JSON (JavaScript Object Notation) or

这些数据一般是JSON(JavaScript Object Notation)或

If you control the web server as well as the client, you can use any format you like; if not, you have to build your application to use whatever the server supports.

如果你能像client 一样能控制web server,你可以使用你喜欢的格式。如果不是,你必须构建你的应用基于server支持的。

2  Starting the Nerdfeed application

 

(1)Create a new Empty Application for the iPad Device Family. Name this application Nerdfeed

(2)Create a new NSObject subclass and

name it BNRCoursesViewController. In BNRCoursesViewController.h, change the superclass to UITableViewController.

@interface BNRCoursesViewController : UITableViewController

In BNRCoursesViewController.m, write stubs for the required data source methods so that you can

build and run as you go through this exercise.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

原标题:iOS Programming Web Services and UIWebView

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。