iOS网络通信基本步骤
//创建URL字符串
NSString *urlStr = @"http://localhost:8080/MyFirstServerForiOS/";
//通过字符串穿件URL
NSURL *url = [NSURL URLWithString:urlStr];
//创建一个请求,制定请求访问的地址。
NSURLRequest *request = [NSURLRequestrequestWithURL:url];
//创建一个连接,指定连接将要发起的请求 .
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
[connection start];