Core Data Error: Can’t Find Model for Source Store

Well, I’m still learning how Core Data works and how it works with iPhone OS 3.0. The following displays how I was able to resolve an error running an app using Core Data and a pre-populated SQLite database. The error gives the reason as “Can’t find model for source store”.

1. Create a new SQLite database with the following tables and columns.

Table

Column

ZFriends
FirstName
LastName
Z_METADATA
Z_VERSION (Int Primary Key)
Z_UUID (VARCHAR(255))
Z_PLIST (BLOB)
Z_PRIMARYKEY
Z_ENT (Int Primary Key)
Z_NAME (VARCHAR)
Z_SUPER (INTEGER)
Z_MAX (INTEGER)

ZFriends is an example of the pre-populated table with the columns (or attributes) FirstName and LastName. Z_METADATA and Z_PRIMARYKEY are the tables necessary for Core Data functionality.

2. Create the Data Model (xcdatamodel file) in XCode.

image

a. Create the Entity (Table Name without the leading ’Z’).

b. Create the attributes (Columns).

Advertisements
Explore posts in the same categories: Uncategorized

Tags: , , ,

You can comment below, or link to this permanent URL from your own site.

6 Comments on “Core Data Error: Can’t Find Model for Source Store”

  1. Chris Palian Says:

    I was wondering if you have been able to implement a UISearchbar with core data.

    Im having a lot of trouble getting it to work.

  2. Chris Palian Says:

    sounds like a plan. So far I have been able to display a UISearchBar and have it when selected control properties about the table view like the index on the right side but when any text is entered into the search field I always receive ‘No Results Found’ even if results should be found.

  3. test Says:

    How do I read Z_VERSION in the Z_METADATA table?
    And, how do I change the Z_VERSION every time I regenerate the database?

    thank you,

  4. rahulvyas Says:

    Does Z_PK,Z_ENT and Z_OPT columns are not required for core Data ?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: