标签:
1 // 同步发送信息 2 NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 3 4 // 解析数据 5 if (data) { // 得到返回数据 6 // 解除屏幕锁 7 [MBProgressHUD hideHUD]; 8 9 // 解析json数据 10 NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil]; 11 12 // 处理返回的数据 13 NSString *result = dict[@"success"]; 14 if (result) { 15 [MBProgressHUD showSuccess:result]; 16 } else { 17 result = dict[@"error"]; 18 if (result) { 19 [MBProgressHUD showError:result]; 20 } 21 } 22 } else { 23 [MBProgressHUD showError:@"网络繁忙,请稍后再试~"]; 24 }
标签:
原文地址:http://www.cnblogs.com/hellovoidworld/p/4248844.html