开发者

How do I switch from a UIView to a UITable View?

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:

searchVie开发者_如何学运维wController = [[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!


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];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜