M
M
Mikhail Dudek2012-04-29 19:44:43
iOS
Mikhail Dudek, 2012-04-29 19:44:43

IOS: How to display a table with a navigation bar in a Cocos2d project?

Hey!
I need to make a page with a menu based on a UITableViewController in a project based on a template for Cocos2d. I was able to place the table itself on the stage, but it is without a navigation bar, although there should be one. I've been struggling with this for more than a day, but I still haven't been able to figure out where I'm stupid. How do I place the table on the stage:

- (id) init
{
    if ((self = [super initWithColor:ccc4(255, 255, 255, 255)])) {
        GamesTableViewController *table = [[GamesTableViewController alloc] initWithStyle: UITableViewStylePlain];
        [[[CCDirector sharedDirector] openGLView] addSubview: [table tableView]];
        /*.....*/
    }
    return self;
}

The GamesTableViewController class inherits UITableViewController.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
deleted-mifki, 2012-04-29
@deleted-mifki

The navigation bar is managed by UINavigationController

[[[CCDirector sharedDirector] openGLView] addsubview: [[[UINavigationController alloc] initWithRootViewController: table] autorelease]]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question