views:

43

answers:

1

I am writing an app that does not utilize a navigationController - there is only one area that requires a UITable.

However, now I am hitting a roadblock when I go to load in that (table) view, with a method such as:

searchViewController = [[SearchViewController alloc] 
                            initWithNibName:@"SearchViewController" bundle:nil];
    [self.view addSubview:searchViewController.view];

Do I need to load the method (below) into my AppDelegate?

UINavigationController *navigationController;

And then, once I do that, can I call that TableView in the same way? Or do I need to use another method, such as the one below:

[window addSubview:[navigationController view]];

Any help is appreciated!

A: 

If you are trying to add a navigation controller to your project, add it to your app delegate header file.

UINavigationController  *navigationController;
@property(nonatomic, retain) IBOutlet UINavigationController *navigationController;

Then in your implemplentation file you would add:

[window addSubview:[navigationController view]];

the "view" is being called from the MainWindow.xib file so you will need to add a navigation controller object to that nib and hook it up to the view you are wanting to fist load.

Of course don't forget to use

@synthesize navigationController;

and release it when dealloc is called.

[navigationController release];
Xcoder
Ok, but I don't have a MainWindow.xib file when I created my project...Is this a problem? Do I need one?I created the project from scratch, not specifying a Navigation-based project...
squeezemylime
Also, I have been using 'self.view addSubview' instead of 'window addSubview'...is this a problem if I want to begin adding 'window addSubview'?
squeezemylime