开发者

UINavigationControl with Image View as root, table views thereafter

开发者 https://www.devze.com 2023-01-17 02:50 出处:网络
This is one that should be simple, but since I\'m rather new to the xcod开发者_JAVA百科e IOS 4 developement, I gotta ask:

This is one that should be simple, but since I'm rather new to the xcod开发者_JAVA百科e IOS 4 developement, I gotta ask:

What I need: an Image View with a button that will then display a series of linked table views. This screams (to me) a UINavigationController where the first view is NOT a table view, but the UIImage view. I cannot get this to work.

Using the NavigationControl project, xcode insists on the first view being a table view. Not what I want. If I use a Window based view and put an image view as the root, attempts to make the secondary view a table view results in it ignoring my data source delegate methods.

Can anyone present a simple/bare bones solution that works?


I think this should be simple.

In your ApplicationDelegate, there should be a line like this:

MyImageViewController *myImageViewController = [[MyImageViewController alloc] init];
self.navigationController = [[[UINavigationController alloc] initWithRootView:myImageViewController] autorelease];

Then, when you want to push another UITableViewController, you can just create push and set delegate to it.

[self.navigationController pushViewController:myTableViewController];

For the delegate and datasource, is your MyTableViewController class inherits from UITableViewController and conforms to UITableViewDelegate, UITableViewDataSource?

That's all I can say without code

0

精彩评论

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