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 7070321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:33:09+00:00 2026-05-28T05:33:09+00:00

Using Xcode 4.2, I created a new app using the tab bar template. For

  • 0

Using Xcode 4.2, I created a new app using the tab bar template. For some reason this template does not give you the option to include Core Data, so I had to add it manually, which I did by following this tutorial:

http://www.theappcodeblog.com/2011/06/30/iphone-development-tutorial-add-core-data-to-a-tab-bar-application-and-save-user-data/

When I run the app however, I get this error:

Cannot create an NSPersistentStoreCoordinator with a nil model

How do I make the model not nil? I have created Model.xcdatamodeld and added an entity (Cat) with attributes.

Also, I want to have the app begin with 5 cats for example, but the user will be able to create more cats. Where/How do I create the original 5 cats? It doesn’t seem logical to create them every time the app starts, but how can you create them in the first place?

  • 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-28T05:33:09+00:00Added an answer on May 28, 2026 at 5:33 am
    1. You’ll need to instantiate a model before you try to create a persistent store coordinator. You can do that with one of the methods of NSManagedObjectModel, such as + mergedModelFromBundles:. Note that if you pass nil to that method, it’ll search the main bundle for models, which is probably what you want.

    2. To populate the store with some initial data, you have a few options. When your app starts up and you’re setting up your Core Data stack, you’ll probably look for an existing persistent store file. If you find it, you can just create the persistent store, add it to the coordinator, and proceed. If you don’t find it, one option is to create a new store and add some objects programmatically. Another options is to keep a pre-populated persistent store file in your bundle which you can copy to the app’s documents folder and then open. A third might be to read the default data from a server on the network and use that to populate a new store.

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

Sidebar

Related Questions

I have Xcode 4 and I created an application using the Tab Bar template
I've created an iPad game using the Universal App Xcode template. Since I'm in
I started a project in Xcode 4.2 using tab view template. In the app
I have created a UItableView using the default Xcode template and configure it to
I've created an application using the Navigation-based template in Xcode. I've also created a
I just installed XCode 4 today (using Apple mac app store), and I created
I'm new to development using Xcode, and am having trouble using the built-in Leaks
I just created a new Xcode project. In the AppControl class Header file I
I want to create a Tableview in a Tab bar application. Because I'm using
How would I change the initial templates created by Xcode when creating a new

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.