I want to ask a question about the iPhone application. I write a program that will display the table. However, I do not know why I can not show the navigation title in the table. The following is my code
// code
- (zero) viewDidoadload {[Super Viewedload]; // Control flow, define the function to another user and add the [self-flow control] item to the table; // Set title self.navigationItem.title = @ "Table Heading Hello"; // see // NSLog (@ "self.navigationItem.title:% @", self.navigationItem.title); } The table can only display items, but not the title. Can anyone help me?
// ---------- Update 1 --------------
Code two in [self-flow control] Functions will call, both function items to add, such as [displayNameArray addObject: @ "John Chan"];
// - --------- 2 update --------------- In my program, there are 2 view controllers.
1) MyViewController
2) The simplest view
First of all, a user is used to enter information, the second is used in the table format Is used to display.
My project name is USERPROJECT
//. The following is the content of #mport "MyViewController.h" #import "USERPROJECT.h" #import "SimpleTableView.h" @information USERPROJECT @ synthesis window; @MyViewControllerControl; - (empty) applicationDiffinish Launching: (UIApplication *) application {MyViewController * aViewController = [[MyViewController alloc] initWithNibName: @ "MyViewController" bundle: [NSBindal main bundle]]; [Self Set MeView Controller: AVI Controller]; [AViewController release]; UIView * controller view = [myViewController view]; [Add windowviewview: controller view]; // Override Point for optimization after the application launch [Window Mikeke & Wisbee]; } - (Zero) Delok {[myViewController release]; [Window release]; [Super DeLoc]; } @end And it is one of the content within 'MyViewController.m', I use it to control 'MyViewController.m' with 'SimpleTableView.m' I am here.
- (zero) SwitchPagesShotable {NSLog (@ "% d: SwitchPagesShowable", order); Order ++; SimpleTableView * Simpleview = [[Simplified Stylize Allocus] Init Whitneyname: Zero Bundle: Zero]; [Self current model visual controller: simplelookview animated: yes]; } Does this calling affect the use of 'self' in the title? Thank you very much.
The title that you expect to see is displayed in a navigation bar, usually To work this part of UINavigationController, you have to do the following:
SimpleTableView * simpleTableView = [[SimpleTableView alloc] initWithNibName: zero bundle: zero]; UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController: simpleTableView]; [Self current model visual controller: animated new controller: yes]; [Simple Stageview release]; [Navinter release]; Instead of (a small nitpick) and
self.navigationItem.title = @ "Table Title Hello"; You can:
self.title = @ "Table heading Hello"; Unless you have a reason to explicitly use the Navigation ID.
Comments
Post a Comment