UIApplication SendEvent崩溃

san*_*alc 5 uikit uiapplication ios

我正在开发示例应用程序,其中我是子类UIApplication和重写sendEvent函数.一切正常但但有时我在函数中得到异常,是他们的任何可能性,[UIApplication SendEvent]可能通过异常?? ..以下是我的代码..

 (void)sendEvent:(UIEvent *)event 
{
    [super sendEvent:event]; 


//Some other things just checking for type of event..etc...

}  
Run Code Online (Sandbox Code Playgroud)

我打电话后就碰到了SIGSEGV [super sendEvent:event];.

小智 0

我认为你应该[super sendEvent:event]在日常活动结束时活动一下。

如果要拦截,则应该最后调用超类方法,而不是首先调用。如果您首先调用 super 方法,它将将该事件传递给所有最终可能吃掉该事件的响应者。