错误消息:[MC] Reading from public effective user settings & [MC] System group container for systemgroup.com.apple.configurationprofiles path is

Error message : [MC] Reading from public effective user settings & [MC] System group container for systemgroup.com.apple.configurationprofiles path is

当我使用以下代码时,出现错误消息:

[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的值设置为disable

感谢 this 讨论,我解决了它。

如果当应用程序尝试使用键盘让用户输入内容时发生。(例如触摸 UITextField,输入密码...) 可能是XCode模拟器的键盘有问题。 关闭模拟器重启即可得到不错的效果