' does not conform to the ' UITabBarControllerDelegate ' protocol"?-6ren"> ' does not conform to the ' UITabBarControllerDelegate ' protocol"?-大家好, 有人知道为什么我会收到附图中的警告吗?在相关代码的正上方是我从一本 Apress 书籍“更多 iPhone 3 开发”中获得的代码的注释。作者试图告诉我一些有关类型转换的信息以消除警告,但我-6ren">
gpt4 book ai didi

ios - "warning: type ' id ' does not conform to the ' UITabBarControllerDelegate ' protocol"?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:49:25 25 4
gpt4 key购买 nike

alt text

大家好,

有人知道为什么我会收到附图中的警告吗?在相关代码的正上方是我从一本 Apress 书籍“更多 iPhone 3 开发”中获得的代码的注释。作者试图告诉我一些有关类型转换的信息以消除警告,但我不知道如何做到。

"warning: type 'id ' does not conform to the 'UITabBarControllerDelegate' protocol"

我没有在我的应用程序中的任何地方使用标签栏或委托(delegate)。我在使用的两个地方都收到相同的警告:

AV_MonitorAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];

获取指向我的应用委托(delegate)的指针。

谢谢。

最佳答案

尝试在赋值之前将其转换为合适的类型,

AV_MonitorAppDelegate *appDelegate = (AV_MonitorAppDelegate *)[[UIApplication sharedApplication] delegate];

关于ios - "warning: type ' id <UIApplicationDelegate> ' does not conform to the ' UITabBarControllerDelegate ' protocol"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4662279/

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