开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜