gpt4 book ai didi

iphone - 如何在不传递委托(delegate)的情况下从 RootViewController 调用 AppDelegate 方法?

转载 作者:可可西里 更新时间:2023-11-01 03:37:59 25 4
gpt4 key购买 nike

如何在不传递委托(delegate)的情况下从 RootViewController 调用 AppDelegate 方法?

只是想知道是否有办法做到这一点? (或者我是否需要在 RootViewController 中创建一个委托(delegate)对象来保存对 AppDelegate 的引用)

最佳答案

[[[UIApplication sharedApplication] delegate] someMethod];

像魅力一样工作!

关于iphone - 如何在不传递委托(delegate)的情况下从 RootViewController 调用 AppDelegate 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5750694/

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