Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Alrighty, what we need to do is use one of the UITableView methods that are already readily available to us. We'll do the following.</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ProteinView *detailViewController = [[ProteinView alloc] initWithNibName:@"ProteinView" bundle:nil]; // It is here we'd pass information from the currently selected UITableViewCell to the ProteinView. // An example of this is the following. // I would do it like this, but others would differ slightly. NSString *titleString = [[[NSString alloc] initWithFormat:@"iPad %d",indexPath.row] autorelease]; // title is an object of detailViewController (ProteinView). In my own instances, I have always made a NSString which in viewDiDLoad is made the self.navigationBar.title string. Look below for what my ProteinView.m and .h would look like. detailViewController.stringTitle = titleString; // ... // Pass the selected object to the new view controller. [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; } </code></pre> <p><strong>EDIT</strong></p> <pre><code>// -------- ProteinView.m -------- // - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. // Here we set the navigationItem.title to the stringTitle. stringTitle is declared in the .h. Think of it as a global scope variable. It is also propertised in the .h and then synthesized in the .m of ProteinView. self.navigationItem.title = stringTitle; } </code></pre> <p>I haven't compiled this, so I don't know if it'll fully work. But that is definitely the fastest and most easiest way to do it!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload