Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone Storyboard Navigation
    primarykey
    data
    text
    <p>I'm new to iPhone development. I've done a couple of android apps now, so thought I'd try my hand on iPhone.</p> <p>However, I really find the storyboard navigation to be counter-intuitive. I've created a basic tabbed app that has 2 screens, both of which contain a table view displaying various bits of data. When a user clicks on a cell of a table, I want it to open a new screen. Simple? Apparently not.</p> <p>I've tried adding a new viewController and ctrl-clicking a table cell in one of my existing tableViews that is linked from the root tabbed view controller to add a seague to the new controller. Clicking a cell has no effect in the simulator.</p> <p>I tried to link the new controller with a custom class to see if this was where I was falling down but even if I create a new Objective-C class that inherits from a UIViewController it won't appear in the drop-down box.</p> <p>Unless I'm mis-understanding how the heirachy of view calls is supposed to work?</p> <p>Any help appreciated!</p> <hr> <p>Edit:</p> <p>OK, so with the below advice I've managed to get further, but I'm still not quite there. I added navigation controllers for each of my tab view options. Then I ctrl-clicked the cell row to link to my new webview controller, choosing a selection seague set to push. I ctrl-clicked the webview to it's controller to make it an outlet delegate and added the following code to the row:</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (_webViewController == nil) { self.webViewController = [[[RSSWebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]] autorelease]; } RSSEntry *entry = [_allEntries objectAtIndex:indexPath.row]; _webViewController.entry = entry; [self.navigationController pushViewController:_webViewController animated:YES]; } </code></pre> <p>I also added:</p> <pre><code>@property (retain, nonatomic) IBOutlet UIWebView *webView; </code></pre> <p>to the new view controllers header file. When I click a row in the simulator, it throws the following exception:</p> <p>2013-03-23 17:21:17.241 RSS[1330:c07] <em>*</em> Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle with name 'WebViewController''.</p> <p>Thanks for the comments so far btw guys. :)</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.
 

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