当前位置: 动力学知识库 > 问答 > 编程问答 >

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

问题描述:

Hey Guys,

Anyone have any idea why I'm getting the warning pictured in the attached image?

Right above the code in question is a comment from the code I got from "More iPhone 3 Development" which is an Apress book. The author trying to tell me something about typecasting to quiet the warning but I don't know how.

"warning: type 'id

' does not

conform to the

'UITabBarControllerDelegate' protocol"

I'm not using a tab bar or it's delegate anywhere in my app.

I get the same warning in both places where I use:

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

to get a pointer to my app delegate.

Thanks.

网友答案:

Try casting it to the appropriate type before the assignment,

AV_MonitorAppDelegate *appDelegate = (AV_MonitorAppDelegate *)[[UIApplication sharedApplication] delegate];
分享给朋友:
您可能感兴趣的文章:
随机阅读: