ios – 如何在添加endIgnoringInteractionEvents之前匹配beginIgnoringInteractionEvents

前端之家收集整理的这篇文章主要介绍了ios – 如何在添加endIgnoringInteractionEvents之前匹配beginIgnoringInteractionEvents前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用这两个函数[[UIApplication sharedApplication] beginIgnoringInteractionEvents];和[[UIApplication sharedApplication] endIgnoringInteractionEvents];我从服务器下载数据时.

我在日志中遇到错误.

-[UIApplication endIgnoringInteractionEvents] called without matching -beginIgnoringInteractionEvents. Ignoring.

我试图在几个链接搜索,但找不到合适的解决方案.

How do you disable touch to screen without using beginIgnoringInteractionEvents?

What is “-[UIApplication beginIgnoringInteractionEvents] overflow. Ignoring.”?

Ignoring UI Events in AppKit

beginIgnoringInteractionEvents or userInteractionEnabled = NO not working as expected

解决方法

你总是可以检查.
if ([[UIApplication sharedApplication] isIgnoringInteractionEvents])...

猜你在找的iOS相关文章