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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:40:59+00:00 2026-06-15T04:40:59+00:00

I am trying to setup CoreData in a new project, but somehow am stuck

  • 0

I am trying to setup CoreData in a new project, but somehow am stuck locating the momd directory.

I found several stackoverflow posts with similar questions, but was unable to solve the problem with the supplied answers. So here it is: What causes the first line to return ‘nil’ and the second one actually finds the momd directory?

NSURL *modelURL = [NSURL fileURLWithPath:
    [[NSBundle mainBundle] pathForResource:@"Project" ofType:@"momd"]
];

NSURL *modelURL = [NSURL fileURLWithPath:
    @"/Users/name/Library/Developer/Xcode/DerivedData/Project-afusjhpzsjyjdbesttxposfzlzrj/Build/Products/Debug/Project.app/Contents/MacOS/Project.momd"
];

Edit: As Metabble commented, It’s now logical that the mainbundle is unable to locate resources outside the Resources folder.

But my problem still exists. I found out some more:
I am using mogenerator to generate classes. (I used these instructions: http://www.esenciadev.com/2011/05/mogen-and-xcode4-integration/).
A script is called by a build rule process ‘Data model version files’. In that build rule I’ve set the output to ‘${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.momd’ but it looks like that is not the correct destination for the momd:

error: Could not create bundle folder for versioned model at '/Users/user/Library/Developer/Xcode/DerivedData/Project-afusjhpzsjyjdbesttxposfzlzrj/Build/Products/Debug/Project.app/Contents/MacOS/Project.momd'

If I delete the build rule, the code can find the momd.
But that disables mogenerator…

Anybody know what output files I need to set in the build rule?

  • 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-06-15T04:41:00+00:00Added an answer on June 15, 2026 at 4:41 am

    Make sure you add a build rule to your project that copies the Project.momd file to your app’s Resource directory.

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

Sidebar

Related Questions

Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
Trying to setup and get going with the RestKit library for a cocoa project
I am new to iPhone development trying to figure out how to setup a
I have a coredata project that I'm trying to programmatically update a number. I'm
I m trying setup a cassandra cluster as a test bed but gave the
Trying to setup a personal image upload/downloader webpage. I've viewed the msdn article on
Trying to setup some validation on the add to cart button for the dropdown
Im trying to setup my asp.net mvc page like the following image: The header
I have been trying to setup git for our web development team unsuccessfully. Some
I'm trying to setup the application server part of C2DM push messaging using this

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.