六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 127|回复: 0

IOS之云端应用

[复制链接]

升级  74%

136

主题

136

主题

136

主题

举人

Rank: 3Rank: 3

积分
422
 楼主| 发表于 2012-12-10 14:34:42 | 显示全部楼层 |阅读模式
<div id="cnblogs_post_body">
10.1 GET请求
10.2 XML解析
10.3 JSON解析
10.4 POST请求
10.1 GET请求

通过一个第三方提供的云服务,查询IP归属地:http://www.youdao.com/smartresult-xml/search.s?type=ip&q=218.241.121.186
它的返回格式是xml :

新建个例子:CSSimpleXML,设计原型:

编辑按钮事件:
<div class="cnblogs_code">- (IBAction)query:(id)sender {    NSString* strUrl = [NSString stringWithFormat:@"http://www.youdao.com/smartresult-xml/search.s?type=ip&q=%@", ipText.text];    NSURL* url = [NSURL URLWithString:strUrl];        NSURLRequest* request = [[NSURLRequest alloc]initWithURL:url];        NSURLConnection* connection = [[NSURLConnection alloc]initWithRequest:request delegate:self];        [connection release];    [request release];    [activityIndicator startAnimating];}
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表