Note that there are some explanatory texts on larger screens.

plurals
  1. POUse pushViewController on separate table delegate
    primarykey
    data
    text
    <p>in <em>PrimaryViewController.h</em> I have an <code>IBOutlet</code> attached to the table I added in the .xib file</p> <pre><code>IBOutlet UITableView *table; </code></pre> <p>in PrimaryViewController.m I construct a new tableController from my TableDataController class and attach it to the table</p> <pre><code>tableController = [[TableDataController alloc] initWithStyle:UITableViewStylePlain]; //Attach the table controller as datasource and delegate to the table [table setDelegate:tableController]; [table setDataSource:tableController]; </code></pre> <p>Now all data in the table is coming from tableController. Since PrimaryViewController is the class being pushed to the stack of the navigationController and not the TableDataController class; using:</p> <pre><code>[self.navigationController pushViewController:newViewController]; </code></pre> <p>in <em>tableController</em> results in nothing as <em>tableController</em> has no <em>navigationController</em>. It is <em>PrimaryViewController</em> who can use the <em>navigationController</em>.</p> <p>What I want to be able to do is to use the function <code>didSelectRowAtIndexPath:</code> in TableDataController to push a new view controller onto the stack of the PrimaryViewController.</p> <p>Please note: I cannot <code>#import "ParimaryViewController.h"</code> into my TableDataController.h so I can send its (<em>PrimaryViewController</em>) object -- they will then be cross-importing each other, creating a semantic error.</p> <p>PrimaryViewController is a regular class that extends UIViewController class with a .xib nothing special. TableDataController is a regular class that extends UITableViewController class with <strong>no</strong> .xib file.</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. This table or related slice is empty.
    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