2011年10月13日 星期四

[Obj-C] [TabBar] Display TabBarController on second view

Delegate.h

@interface AppDelegate : NSObject 
{
    UITabBarController *tabBarController;
}

@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;

Delegate.m

@synthesize tabBarController;

- (void)showTabBar
{
    [loginController.view removeFromSuperview];
    [self.window addSubview:tabBarController.view];
}

TestController.m

#import "Delegate.h"

- (IBAction)showTabBar
{
  UIApplication *app = [UIApplication sharedApplication];
  [(FindSoneAppDelegate *)app.delegate showTabBar];
}

沒有留言:

張貼留言