iOS 10:“[App] 如果我们在真正的预提交处理程序中,由于 CA 限制,我们实际上无法添加任何新围栏”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38458170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:43:08  来源:igfitidea点击:

iOS 10: "[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction"

ios

提问by swalkner

I sometimes get this message in the logs of Xcode 8b3 when running my app, everything seems to work, but I'd like to know where this comes from. Google did not help at all.

运行我的应用程序时,我有时会在 Xcode 8b3 的日志中收到此消息,似乎一切正常,但我想知道这是从哪里来的。谷歌根本没有帮助。

回答by Ed.

in your Xcode:

在您的 Xcode 中:

  • Click on your active scheme name right next to the Stop button
  • Click on Edit Scheme....
  • in Run (Debug) select the Arguments tab
  • in Environment Variables click +
  • add variable: OS_ACTIVITY_MODE = disable
  • 单击“停止”按钮旁边的活动方案名称
  • 单击编辑方案....
  • 在 Run (Debug) 中选择 Arguments 选项卡
  • 在环境变量中单击 +
  • 添加变量:OS_ACTIVITY_MODE = 禁用

screenshot

截屏

回答by Roman Ermolov

It comes from +[UIWindow _synchronizeDrawingAcrossProcessesOverPort:withPreCommitHandler:]via os_log API. It doesn't depend from another components/frameworks that you are using(only from UIKit) - it reproduces in clean single view application project on changing interface orientation.

它来自+[UIWindow _synchronizeDrawingAcrossProcessesOverPort:withPreCommitHandler:]通过 os_log API。它不依赖于您正在使用的其他组件/框架(仅来自 UIKit) - 它在更改界面方向时在干净的单视图应用程序项目中重现。

This method consists from 2 parts:

该方法由两部分组成:

  1. adding passed precommit handler to list of handlers;
  2. do some work, that depends on current finite state machine state.
  1. 将传递的预提交处理程序添加到处理程序列表中;
  2. 做一些工作,这取决于当前的有限状态机状态。

When second part fails (looks like prohibited transition), it prints message above to error log. However, I think that this problem is not fatal: there are 2 additional assert cases in this method, that will lead to crash in debug.

当第二部分失败(看起来像被禁止的转换)时,它会将上面的消息打印到错误日志中。但是,我认为这个问题并不致命:这个方法中还有2个额外的断言情况,会导致调试时崩溃。

Seems that radar is the best we can do.

看来雷达是我们能做的最好的了。

回答by Nick Peachey

Try putting the following in the environment variablesfor the scheme under run(debug)

尝试将以下内容放入environment variables方案中run(debug)

OS_ACTIVITY_MODE = disable

回答by Igor

We can mute it in this way (device and simulator need different values):

我们可以通过这种方式将其静音(设备和模拟器需要不同的值):

Add the Name OS_ACTIVITY_MODEand the Value ${DEBUG_ACTIVITY_MODE}and check it (in Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).

添加名称OS_ACTIVITY_MODE和值${DEBUG_ACTIVITY_MODE}并检查它(在产品 -> 方案 -> 编辑方案 -> 运行 -> 参数 -> 环境中)。

enter image description here

在此处输入图片说明

Add User-Defined Setting DEBUG_ACTIVITY_MODE, then add Any iOS Simulator SDKfor Debugand set it's value to disable(in Project -> Build settings -> + -> User-Defined Setting)

添加 User-Defined Setting DEBUG_ACTIVITY_MODE,然后添加Any iOS Simulator SDKforDebug并将其值设置为disable(在 Project -> Build settings -> + -> User-Defined Setting 中)

enter image description here

在此处输入图片说明

回答by Jeff

To fix, I deleted the app from Simulator.

为了修复,我从模拟器中删除了该应用程序。

I also ran Cleanfirst.

我也先跑了Clean

I do not think anything orientation-related triggered it. The biggest thing that changed before this symptom started is that a Swift framework started calling NSLogon worker threads instead of main thread.

我不认为任何与方向相关的事情会触发它。在此症状出现之前发生的最大变化是 Swift 框架开始调用NSLog工作线程而不是主线程。

回答by kindaian

OS_ACTIVITY_MODE = disable

This will also disable the ability to debug in real devices (no console output from real devices from then on).

这也将禁用在真实设备中调试的能力(从那时起真实设备没有控制台输出)。