项目中: Assigning to 'AppDelegate *' from incompatible type 'id'。
这个警告应该怎么解决额?
在.m中声明:
AppDelegate *appdev;
在viewDidLoad中
{
appdev = [[UIApplication sharedApplication]delegate]; <= warning here
}
我想隐藏这个警告,可以么?
需要隐式指明类型,改成
appdev =(AppDelegate *)[[UIApplication sharedApplication] delegate];