【发布时间】:2014-12-11 06:45:44
【问题描述】:
我将一个UITabBar 拖放到我的UIViewController (xib) 中,然后我创建了这样的对象
@property (strong, nonatomic) IBOutlet UITabBar *tabbar;
我添加了UITabBarDelegate,我的didSelectViewController 代码是:
-(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
NSLog(@"Selected INDEX OF TAB-BAR ==> %i", tabBarController.selectedIndex);
if (tabBarController.selectedIndex == 3) {
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"APICON" message:@"test" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}
}
但是当我点击UITabBar时,物品提醒没有出现,为什么?
【问题讨论】:
-
我在界面生成器中通过将行拖动到文件所有者来设置它
-
您缺少代表...为标签栏添加代表...
-
已添加,但不是那个问题
标签: ios objective-c uiviewcontroller uitabbarcontroller