syxChina 发表于 2012-12-19 22:15:54

IOS之云端应用

<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 :
http://images.cnblogs.com/cnblogs_com/syxchina/201210/201210142244081069.png
新建个例子:CSSimpleXML,设计原型:
http://images.cnblogs.com/cnblogs_com/syxchina/201210/201210142244093096.png
编辑按钮事件:
<div class="cnblogs_code">- (IBAction)query:(id)sender {    NSString* strUrl = @"http://www.youdao.com/smartresult-xml/search.s?type=ip&q=%@", ipText.text];    NSURL* url = ;      NSURLRequest* request = [initWithURL:url];      NSURLConnection* connection = [initWithRequest:request delegate:self];      ;    ;    ;}
页: [1]
查看完整版本: IOS之云端应用