为什么AppDelegate继承自UIResponder? [英] Why does AppDelegate inherit from UIResponder?

查看:117
本文介绍了为什么AppDelegate继承自UIResponder?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I noticed that when creating a new project with the iPhone Master-Detail template in Xcode 4.2 beta 4, it does:

// AppDelegate.h

@interface AppDelegate : UIResponder <UIApplicationDelegate>

为什么 AppDelegate 继承自 UIResponder 而不是 NSObject

推荐答案

转换为Storyboards发行说明


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

Note: In the current Xcode templates, the application delegate class inherits from UIResponder. This is so that the delegate instance can participate in the responder chain and so handle application-level actions. If you haven’t made use of this pattern in an existing application, there’s no need to adopt it for storyboards.

这篇关于为什么AppDelegate继承自UIResponder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆