gpt4 book ai didi

iphone - 从子类应用程序委托(delegate)调用应用程序委托(delegate)方法

转载 作者:行者123 更新时间:2023-11-29 05:03:42 24 4
gpt4 key购买 nike

所以我是 iOS 编程新手。我正在使用 SDK 4.0,您知道当您构建通用项目时,它们会为您提供完整项目的应用程序委托(delegate)以及 iphone 和 ipad 的两个子类应用程序委托(delegate)类。

问题是我如何从扩展应用程序委托(delegate)的子类应用程序委托(delegate)类中调用应用程序委托(delegate)方法。

像这样

#import "AppDelegate.h"


@interface AppDelegate_iPhone : AppDelegate
{
// have to call the AppDelegate methods and its objects.


}

最佳答案

您可以使用 super 向父类/父类(super class)发送消息喜欢 [super doThisMethod]; .如果您必须使用父类(super class)中声明的 ivar 或属性,您可以直接引用它们,因为它们在您的类中声明 - ivarself.property .

但是你应该阅读 Apple's guide 首先是 Objective-C。它有很好的记录。

关于iphone - 从子类应用程序委托(delegate)调用应用程序委托(delegate)方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6201819/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com