更新时间:2022-11-02 10:03:20
如果使用的是 NSDefaultRunLoopMode
,则 UIAPPlication
会添加运行循环模式 UITrackingRunLoopMode
用于跟踪滚动等滚动视图事件.由于 UIApplication
从 NSDefaultRunLoopMode
切换到 UITrackingRunLoopMode
,因此直到 UIAPPlication
切换回 NSDefaultRunLoopMode
.
If you are using NSDefaultRunLoopMode
, UIAPPlication
adds a run loop mode UITrackingRunLoopMode
for tracking scrollview events like scrolling. Since the UIApplication
switches from NSDefaultRunLoopMode
to UITrackingRunLoopMode
any events on NSDefaultRunLoopMode
will not be called until UIAPPlication
switch back to NSDefaultRunLoopMode
.
可能是问题所在,解决方法是将 NSDefaultRunLoopMode
更改为 NSRunLoopCommonModes
.
It might be the problem, the fix is change NSDefaultRunLoopMode
to NSRunLoopCommonModes
.
如果您不确定是否正在使用runloop(如注释中所述).只需在您的项目中搜索 NSDefaultRunLoopMode
.
If you are not sure whether you are using runloop or not as you mentioned in comment. Just search NSDefaultRunLoopMode
in your project.