开发者

How to add navigation controller in View Based Application in iPhone?

开发者 https://www.devze.com 2023-01-29 05:30 出处:网络
My application is view based appln. So how can i implement navigation controller in my apps. If i have used this code, my controller works fine.

My application is view based appln. So how can i implement navigation controller in my apps.

If i have used this code, my controller works fine.

   FirstClass *first = [[FirstClass alloc] ini开发者_Python百科tWithNibName:@"FirstClass" bundle:nil];

   [self presentModalViewController:first animated:NO];

But using navigation controller in my apps, the navigation controller doesn't work.

    FirstClass *first = [[FirstClass alloc] initWithNibName:@"FirstClass" bundle:nil];

    UINavigationController *navigNews = [[[UINavigationController alloc] initWithRootViewController:first] autorelease(or retain)];

    [self.navigationController pushViewController:navigNews animated:YES];

So how can i add the navigation controller in my application. If i have added the navigation controller in my root view, i have faced some problem. so how can i add the navigation controller in the particular view.

Please help me out.

Thanks!


Try adding:

[self.view addSubview:navigNews.view];

0

精彩评论

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

关注公众号