【问题标题】:Error message : [MC] Reading from public effective user settings & [MC] System group container for systemgroup.com.apple.configurationprofiles path is错误消息:[MC] 从公共有效用户设置中读取和 [MC] systemgroup.com.apple.configurationprofiles 路径的系统组容器是
【发布时间】:2017-02-27 00:29:21
【问题描述】:

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

[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 的错误调用?

提前谢谢你。

【问题讨论】:

    标签: ios objective-c xcode nsurlconnection sendasynchronousrequest


    【解决方案1】:

    我想到了。当我使用 textField 时,控制台中的相同日志。以下是我的操作:

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

    感谢this 讨论,我解决了。

    【讨论】:

    • 准确地说,它只是隐藏了控制台的日志记录——它可能不是你想要的。
    • 这并不能解决问题的真正根源。它只会使结果静音。
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-26
      • 1970-01-01
      • 2017-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多