为什么AppDelegate继承自UIResponder?

ma1*_*w28 17 uiresponder ios

我注意到在Xcode 4.2 beta 4中使用iPhone Master-Detail模板创建一个新项目时,它确实:

// AppDelegate.h

@interface AppDelegate : UIResponder <UIApplicationDelegate>
Run Code Online (Sandbox Code Playgroud)

为什么AppDelegate继承UIResponder而不是NSObject

cah*_*ahn 13

转换为故事板发行说明:

注意:在当前的Xcode模板中,应用程序委托类继承自UIResponder.这样,委托实例可以参与响应程序链,从而处理应用程序级操作.如果您尚未在现有应用程序中使用此模式,则无需将其用于故事板.


yan*_*yan 3

检查 的文档UIResponder。由于AppDelegate可以响应触摸事件,因此它实现了该UIResponder接口。