Note that there are some explanatory texts on larger screens.

plurals
  1. POTabBarController doesn't load ViewControllers with CoreData
    primarykey
    data
    text
    <p>It's strange but when I test my two <code>ViewControllers</code> separately, they work just fine. When they are inside of the <code>TabBarController</code> with the following code they don't work anymore - they don't get loaded. I have a breakpoint in the <code>viewDidLoad</code> method, which is not being called.</p> <p>I had done a dummy of my project before I started working with <code>CoreData</code> and it was working perfectly with this code. So the problem started when the view controllers got their data from <code>CoreData</code>.</p> <p>Thinking that <code>CoreData</code> was the problem, I decided to implement a <code>UITabBarController</code> in the <code>CoreDataBooks</code> example from Apple. It worked just fine.</p> <p>I found some threads addressing some issues with <code>CoreData</code> and <code>TabBarControllers</code> but these where using IB. I don't have any .xib files in my project! </p> <p>I'm clueless. Suggestions will be very appreciated!</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UITabBarController *tabBarController = [[UITabBarController alloc] init]; ProjectRootViewController *projectRootViewController = [[ProjectRootViewController alloc] initWithStyle:UITableViewStylePlain]; WorkTimeRootViewController *workTimeRootViewController = [[WorkTimeRootViewController alloc] initWithStyle:UITableViewStylePlain]; NSManagedObjectContext *context = [self managedObjectContext]; if (!context) { NSLog(@"Problems loading context."); } projectRootViewController.managedObjectContext = context; workTimeRootViewController.managedObjectContext = context; UINavigationController *projectNavigationController = [[UINavigationController alloc] initWithRootViewController:projectRootViewController]; UINavigationController *workTimeNavigationController = [[UINavigationController alloc] initWithRootViewController:workTimeRootViewController]; [projectRootViewController release]; [workTimeRootViewController release]; navigationControllers = [[NSArray alloc] initWithObjects:projectNavigationController, workTimeNavigationController, nil]; [projectNavigationController release]; [workTimeNavigationController release]; [tabBarController setViewControllers:navigationControllers]; [self.window addSubview:[tabBarController view]]; [tabBarController release]; [self.window makeKeyAndVisible]; return YES; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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