iphone-使用tabbarcontroller时出现分配给不兼容类型错误
我是一个ios开发新手。当我尝试这样做时,我会出错iphone-使用tabbarcontroller时出现分配给不兼容类型错误,iphone,ios,Iphone,Ios,我是一个ios开发新手。当我尝试这样做时,我会出错 tabBarController.delegate = self; 错误为“从不兼容的类型“MyAppDelegate*”分配给“id UITableControllerDelegate” 我做错了什么?您需要让您的MyAppDelegate实现uitabarcontrollerdelegate协议 在MyAppDelegate的界面中,用@interface MyAppDelegate:NSObject 显示您实现了UITabBarCont
tabBarController.delegate = self;
错误为“从不兼容的类型“MyAppDelegate*”分配给“id UITableControllerDelegate”
我做错了什么?您需要让您的
MyAppDelegate
实现uitabarcontrollerdelegate
协议
在MyAppDelegate
的界面中,用@interface MyAppDelegate:NSObject
显示您实现了UITabBarControllerDelegate
协议,这是tabBarController.delegate的预期。delegate
您需要让您的MyAppDelegate
实现UITabBarControllerDelegate
协议
在MyAppDelegate
的界面中,用@interface MyAppDelegate:NSObject
显示您实现了UITabBarControllerDelegate
协议,这是tabBarController.delegate所期望的。delegate
如果有帮助,我在我的应用程序delegate的didfinitishlaunchingwithoptions方法中调用它。如果有帮助,我在我的应用程序delegate的didfinitishlaunchingwithoptions方法中调用它helps.UIApplicationLegate也是一个协议,而不是一个类。正确的声明应该是@interface MyAppDelegate:NSObject
哦,对不起。这就是我在souiapplicationelegate中编码得到的,它也是一个协议,而不是一个类。正确的声明应该是@interface MyAppDelegate:NSObject
哦,对不起。这就是我在这么短的时间内