21
无法加载资源,因为“应用程序传输安全性”策略要求使用安全连接
将Xcode更新为7.0或iOS 9.0时遇到问题。它以某种方式开始给我标题错误 “无法加载资源,因为应用程序传输安全策略需要使用安全连接” Web服务方法: -(void)ServiceCall:(NSString*)ServiceName :(NSString *)DataString { NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration]; [sessionConfiguration setAllowsCellularAccess:YES]; [sessionConfiguration setHTTPAdditionalHeaders:@{ @"Accept" : @"application/json" }]; NSURLSession *session = [NSURLSession sessionWithConfiguration:sessionConfiguration]; NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",ServiceURL]]; NSLog(@"URl %@%@",url,DataString); // Configure the Request NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setValue:[NSString stringWithFormat:@"%@=%@", strSessName, strSessVal] forHTTPHeaderField:@"Cookie"]; request.HTTPBody …