为UINavigationController设置类

时间:2010-10-09 04:18:54

标签: iphone xcode ios4

如何从代码中为UINavigationController设置类(第一类)?

1 个答案:

答案 0 :(得分:0)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

     window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
     LoginViewController* loginViewctrl = [[LoginViewController alloc] init];
     navigationController = [[UINavigationController alloc] initWithRootViewController:loginViewctrl];
     UIWindow* window addSubview:[navigationController view]];
     [loginViewctrl release];
     [window makeKeyAndVisible];
}