Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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 未捕获异常:-{WebDataSource indexof::]:使用框架时无法识别选择器_Iphone_Ios_Tabbar_Uitabbaritem - Fatal编程技术网

Iphone 未捕获异常:-{WebDataSource indexof::]:使用框架时无法识别选择器

Iphone 未捕获异常:-{WebDataSource indexof::]:使用框架时无法识别选择器,iphone,ios,tabbar,uitabbaritem,Iphone,Ios,Tabbar,Uitabbaritem,您好,我被创建为tabbarcontroller framework all使用源代码正常工作,但创建的框架在选择一个索引到另一个索引时出错 -{WebDataSource indexof::无法识别的选择器实例 我得到了上面的错误 有什么想法吗 我声明了如下的tabbar项 - (void)ItemPressed:(id)sender { NSInteger index = [self.tabBarItems indexOfObject:sender]; BOOL shoul

您好,我被创建为tabbarcontroller framework all使用源代码正常工作,但创建的框架在选择一个索引到另一个索引时出错

-{WebDataSource indexof::无法识别的选择器实例
我得到了上面的错误

有什么想法吗

我声明了如下的tabbar项

 - (void)ItemPressed:(id)sender {
    NSInteger index = [self.tabBarItems indexOfObject:sender];
    BOOL shouldSelect = [self delegatedDecisionIfWeShouldSelectViewController:[self.viewControllers objectAtIndex:index] atIndex:index];

    if (shouldSelect) {
        if (index != self.selectedIndex) {
            self.selectedIndex = index;
        } else {
            if ([self.selectedViewController isKindOfClass:[UINavigationController class]]) {
                UINavigationController *navigationController = (UINavigationController *)self.selectedViewController;

                [navigationController popToRootViewControllerAnimated:YES];
            }
        }
    }
}

我希望您希望
self.tabBarItems
是一个
NSArray
对象。但是在这里,该对象引用了一些其他实例,比如
WebDataSource
的实例


是否可以显示您是如何声明和填充数组的
tabBarItems

您好,添加了源代码,请检查它,但是,您在哪里添加了按钮的操作?
vc1 = [[webviewname alloc] initUrl:[NSURL URLWithString:@"https://www.google.com"]];
    vc2 = [[webviewname  alloc] initUrl:[NSURL URLWithString:@"https://www.yahoo.com"]];

    vc1.O_tabBarItem = [OTabBarItem itemWithTitle:@"index" image:[UIImage imageNamed:@"index"]];
    vc2.O_tabBarItem = [OTabBarItem itemWithTitle:@"index" image:[UIImage imageNamed:@"index"]];


    vc1.delegate=self;
    vc2.delegate=self;

    NSArray *vControl = [NSArray arrayWithObjects:vc1,vc2,nil];