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 – 如何在添加endIgnoringInteractionEvents之前匹配beginIgnoringInteractionEvents全部内容,希望文章能够帮你解决ios – 如何在添加endIgnoringInteractionEvents之前匹配beginIgnoringInteractionEvents所遇到的程序开发问题。

如果觉得来客网网站内容还不错,欢迎将来客网网站推荐给程序员好友。