Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6354659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:36:43+00:00 2026-05-24T22:36:43+00:00

I am using a MainWindow.xib file that has the following configuration: MainWindow.xib UITabBarController UINavigationBarController

  • 0

I am using a MainWindow.xib file that has the following configuration:

MainWindow.xib

  • UITabBarController
    • UINavigationBarController
      • UITableViewControllerAlpha
    • UINavigationBarController
      • UITableViewControllerBeta
    • UINavigationBarController
      • UITableViewControllerCharlie

But based on the following post:
Why does Core Data initialization fail when I attempt to do it at these points?
and the breakpoints that I’ve placed, I’ve come to the conclusion that initWithCoder is being used to init all of the UITableViewControllers and that there is no way to reliably use the managedObjectContext at that point in the applicaiton lifecycle.

So does this mean that I have to throw out all the “easy” design work and layout that I’ve performed in MainWindow.xib and do it programatically? Does using core data, really mean not being able to use NIB files? Or is there some middle-ground?

Please let me know, Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:36:44+00:00Added an answer on May 24, 2026 at 10:36 pm

    There’s no problem using Core Data, table views, and NIBs together. I presume you need to fetch some objects from the MOC for your table view, and you’re having problems finding the MOC when you need to do that.

    This approach works for me:

    • Define nib as target’s main interface.
    • Load nav controller and root view controller in nib.
    • Set root view controller’s managedObjectContext property in applicationDidFinishLaunching:
    • Fetch from MOC in root view controller’s viewDidLoad

    So, try this first:

    • Have the app delegate set the controller’s managedObjectContext in applicationDidFinishLaunching:
    • Do the fetch in viewDidLoad instead of initWithCoder.

    If that doesn’t work, you still have at least these options:

    1. Set the controller’s managedObjectContext in applicationDidFinishLaunching:, but don’t fetch data until your data source methods are called. In those methods, conditionally complete the fetch if it hasn’t already been done.

    2. Write a method like loadDataFromMOC: on your controller, which both sets the MOC and fetches from it, and call it from applicationDidFinishLaunching:.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active
I recently having my mainwindow write text by using WM_PAINT, but now I realise
I'm using a custom OpenCV VideoProcessor-Class in my QtGui-Application. My MainWindow has 2 ViewerWidgets
When using FxCop 1.36 for a WPF application with a single window that has
I have downloaded an Xcode project that has three xibs (A.xib, B.xib, and C.xib).
My main xib file has a tab bar controller and each tab is linked
I am using XCode 4.0.2 and I accidentally deleted MainWindow.xib. I used SVN to
I am using a QStackedWidget on my mainWindow. The firstPageWidget on stackedWidget contains 3
Using ASP.NET MVC there are situations (such as form submission) that may require a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.