当试图使用po data打印数据时,它说
错误:使用未声明的标识符“数据” 错误:1错误解析表达式
-(void)viewWillAppear:(BOOL)animated {
NSMutableURLRequest*req=[[NSMutableURLRequest alloc]init];
NSURL*url=[NSURL URLWithString:@"http://www.thomas-bayer.com/sqlrest/CUSTOMER/"];
[req setURL:url];
[[[NSURLSession sharedSession]dataTaskWithRequest:req completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
if(error){
NSLog(@"error");
}else{}
}] resume];
}发布于 2016-11-27 11:43:32
控制台下面有错误吗?
App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.我觉得您必须将异常配置为"http:“url。
请看下面的问题,以了解添加例外。
更新:
上面的url提供了xml响应,请参阅下面的xml解析链接。
发布于 2016-11-28 02:33:42
也许您可以在“否则”的branch.When中设置一个断点--数据返回,然后在其中触发断点,使用"po数据“。
https://stackoverflow.com/questions/40828409
复制相似问题