Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphone-使用tabbarcontroller时出现分配给不兼容类型错误_Iphone_Ios - Fatal编程技术网

iphone-使用tabbarcontroller时出现分配给不兼容类型错误

iphone-使用tabbarcontroller时出现分配给不兼容类型错误,iphone,ios,Iphone,Ios,我是一个ios开发新手。当我尝试这样做时,我会出错 tabBarController.delegate = self; 错误为“从不兼容的类型“MyAppDelegate*”分配给“id UITableControllerDelegate” 我做错了什么?您需要让您的MyAppDelegate实现uitabarcontrollerdelegate协议 在MyAppDelegate的界面中,用@interface MyAppDelegate:NSObject 显示您实现了UITabBarCont

我是一个ios开发新手。当我尝试这样做时,我会出错

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
哦,对不起。这就是我在这么短的时间内