当我使用以下代码时,出现错误消息:
[NSURLConnection sendAsynchronousRequest:request queue:myQueue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"response status code: %ld, error status : %@", (long)[httpResponse statusCode], error.description);
if ((long)[httpResponse statusCode] >= 200 && (long)[httpResponse statusCode]< 400)
{
// do stuff
[self requestFunction]; //Web Service
}
}];
错误信息:
2017-02-27 01:13:30.088641 RENAULT[210:12313] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-02-27 01:13:30.090449 RENAULT[210:12313] [MC] Reading from public effective user settings.
[self requestFunction] 函数发起一个简单的请求:
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] init];
NSString *url_string = [bytes stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
[request setURL:[NSURL URLWithString:[set_send_order stringByAppendingString: url_string]]];
[request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
[request setTimeoutInterval:timeOut];
[NSURLConnection connectionWithRequest:request delegate:self];
我明确指出 connectionDidFinishLoading: 没有被调用,但是如果我在没有 sendAsynchronousRequest: 的情况下直接启动它,它就可以工作。 那么为什么我使用 sendAsynchronousRequest: 函数让我出现两条错误消息,以及 connectionDidFinishLoading 的错误调用?
提前谢谢你。
最佳答案
我想到了。当我使用 textField 时,相同的日志记录在控制台中。以下是我的操作:
- 从 Xcode 菜单打开:产品 > 方案 > 编辑方案
- 在您的环境变量中将 OS_ACTIVITY_MODE 的值设置为禁用
感谢this,我解决了这个问题讨论。
关于ios - 错误信息 : [MC] Reading from public effective user settings & [MC] System group container for systemgroup. com.apple.configurationprofiles 路径是,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42476012/