开发者

Using a UITabBar in a View-based app not working

开发者 https://www.devze.com 2023-02-28 23:17 出处:网络
I have added a UITabBar to a View-based application, hooked up my View Controller as follows: @interface SomeViewController : UIViewController<UITabBarDelegate> {

I have added a UITabBar to a View-based application, hooked up my View Controller as follows:

@interface SomeViewController : UIViewController<UITabBarDelegate> {    

...

UITabBar *tabBar;

...

@property (nonatomic, retain) IBOutlet UITabBar *tabBar;

Inside my implementation file I have done this:

@synthesize tabBar;

- (void)tabBar: (UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
}

I went into IB and hooked tabBar up to File's Owner tabBar.

My problem: clicking on 开发者_开发知识库a tab bar item never fires off the didSelectItem method. Am I missing or mis-doing a step?


Did you set the delegate of the tabbar to self?

0

精彩评论

暂无评论...
验证码 换一张
取 消