Note that there are some explanatory texts on larger screens.

plurals
  1. POPopulating a TableViewController that is not the rootViewController of my NavigationController
    primarykey
    data
    text
    <p>Okay so i have done a tutorial that has me populating a TableViewController from the appDelegate.m file in this way. </p> <p><code>UINavigationController *navController = (UINavigationController *) self.window.rootViewController; MasterViewController *masterController = [navController.viewControllers objectAtIndex:0]; masterController.bugs = bugs;</code></p> <p>I am attempting my own small app for some practice but the way i'm doing it my TableViewController is not the rootViewController. It is the next view after that. I am using storyboards to create my GUI, not sure if that is a needed to know thing. </p> <p>Basically I have my object that has an member that is and array and I want to create the object in the appDelegate file and populate the TableViewController with the array from my object.</p> <p>Here is some extra details:</p> <p>I did was was suggested and replaced the 0 index with a 1 but i get this exception error </p> <p>2012-10-07 21:34:23.785 EasyBudget[5257:f803] <strong>* Terminating app due to uncaught exception 'NSRangeException', reason: '*</strong> -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]' <em>*</em> First throw call stack: (0x14b5022 0xeb5cd6 0x14a1644 0x20c8 0x16386 0x17274 0x26183 0x26c38 0x1a634 0x139fef5 0x1489195 0x13edff2 0x13ec8da 0x13ebd84 0x13ebc9b 0x16c65 0x18626 0x1efd 0x1e65 0x1) terminate called throwing an exception</p> <p>I understand the reason for the exception. For some reason my the Array that holds the different views from my navigation controller only has a 0 index. I'm just not sure how to fix this. I set my storyboard up in the way Navigation Controller -> ViewController (which is my root view relationship) -> Table View Controller (this is the view i'm trying to access). I added a bar button item with a push segue from my root view controller to the table view controller. When i built and ran before adding code everything worked I could push my button and it went from my view controller to my table view controller and i was able to push the back button the was automagically made by the navigation bar to get back to my view controller. I hope this was all done correctly. Any more help would be greatly appreciated.</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.
 

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