您的位置:首页 > 移动开发

Assigning to 'AppDelegate *' from incompatible type 'id<UIApplicationDelegate>'

2015-12-20 21:47 691 查看
down
votefavorite
In my project it says Assigning to 'AppDelegate *' from incompatible type 'id'.

May I know what exactly this? Why this warning occurred?

I have declared in .m
AppDelegate *appdev;


and in viewDidLoad
{
appdev = [[UIApplication sharedApplication]delegate];     <= warning here
}


I want to hide this warning. What should I do? Thanks in advance.
===========================================================================

since you know they equal, add a cast to let the compiler know
appdev = (AppDelegate*)[[UIApplication sharedApplication]delegate];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: