【问题标题】:view controller may not respond to 'activatetab'视图控制器可能不响应“activatetab”
【发布时间】:2012-05-23 16:40:02
【问题描述】:

一切正常,但我找不到关于我收到的两个警告的任何信息。这是其中之一。

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item {
NSLog(@"didSelectItem: %d", item.tag);

[self activateTab:item.tag];   //<------viewcontroller may not respond to activateTab 
}

- (void)activateTab:(int)index {
switch (index) {
    case 1:{

在调试器中显示

没有匹配方法签名的消息将被假定返回'id'并接受'...'作为参数。

【问题讨论】:

    标签: iphone xcode


    【解决方案1】:

    你也需要在你的头文件中声明方法activateTab:

    【讨论】:

    • 或者放在tabBar:didSelectItem上面
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多