0
- (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];
}
}
}
}
嗨,我創建tabbarcontroller框架所有做工精細用源但同時選擇一個索引到另一個未捕獲的異常: - {WebDataSource的indexOf:]:無法識別選擇同時使用框架
創建框架得到錯誤-{WebDataSource indexof:]: unrecognized selector instance
我得到了上述錯誤。
有什麼想法?
我宣佈的TabBar的項目,如下面
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];
嗨添加源請檢查它 –
但是,在哪裏添加了按鈕的操作? – Ilanchezhian