错误消息:[MC]从公共有效用户设置读取和[MC] systemgroup.com.apple.configurationprofiles路径的系统组容器是

Ωlo*_*stA 8 xcode objective-c nsurlconnection ios sendasynchronousrequest

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

[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
            }
}];
Run Code Online (Sandbox Code Playgroud)

错误消息:

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.
Run Code Online (Sandbox Code Playgroud)

[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]; 
Run Code Online (Sandbox Code Playgroud)

我确切地说没有调用connectionDidFinishLoading:但是如果我在没有sendAsynchronousRequest:的情况下直接启动它,它就可以工作了.那么为什么我使用sendAsynchronousRequest:function的事实让我出现了两个错误消息,并且错误地调用了connectionDidFinishLoading?

先感谢您.

小智 27

它发生在我身上.我使用textField时在控制台中记录相同的日志.跟着是我的操作:

  • 从Xcode菜单打开:产品>方案>编辑方案
  • 在您的环境变量上,在值集disable中设置OS_ACTIVITY_MODE

由于这次讨论,我解决了这个问题.

  • 确切地说,它只是隐藏了从控制台登录 - 它可能不是你想要的. (5认同)