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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:01:54+00:00 2026-05-26T22:01:54+00:00

I am currently working though this tutorial , that explains how to add Core

  • 0

I am currently working though this tutorial, that explains how to add Core Data to an existing project.

I am up to the part titled

AppDelegate.m

It says this:

Implement applicationDocumentsDirectory, and explicitly write accessor methods for each new property as opposed to simply using the
@synthesize keyword. Note in the persistentStoreCoordinator accessor
there is a location where you must name the SQLite file used for the
store; this should most likely be your project name. Remember to
properly release each object in dealloc:

I do not understand what this part is asking me to do

Implement applicationDocumentsDirectory, and explicitly write accessor methods for each new property as opposed to simply using the
@synthesize keyword.

From what I can tell its asking me to implement the variables differently from how I normally do them with the @synthesize.. but im not sure how else to do it…if someone could help me out that would be awesome.

Here is my property code

//Core Data
@property (nonatomic, strong, readonly) NSManagedObjectModel *managedObjectModel;
@property (nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;
  • 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-26T22:01:54+00:00Added an answer on May 26, 2026 at 10:01 pm

    I think what that particular paragraph is saying is that you need to create custom getters for your CoreData ivars.

    For instance, if you look at a fresh new template project created by Xcode, you will notice that all of the CoreData properties have their custom getters set, and they lazily instantiate/create the ivars the first time you access them.

    For instance, the method below checks if your managedObjectContext ivar is not nil, in which case the context has already been created so the getter method will simply return it to the calling method (which is typically you accessing the managedObjectContext property with self.managedObjectProperty)

    - (NSManagedObjectContext*)managedObjectContext
    {
        if (_managedObjectContext != nil)
           return _managedObjectContext
        _managedObjectContext = ...
    }
    

    The applicationsDocumentDirectory method is just a convenience method that returns the path to the documents directory which will then be used by your persistent store coordinator to set the path for your CoreData database file.

    Your best bet is to create a new project and copy the entire CoreData stack from the AppDelegate onto your existing project. You will then need to create a managed object model and make sure you have set the name correctly in the NSManagedObjectModel method, then you should be good to go.

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

Sidebar

Related Questions

I am currently working through this tutorial: Getting Started with jQuery For the two
I'm working though the First Steps tutorial on the POCO Project site, and I've
I'm currently working through an assignment that deals with Big-O and running times. I
I'm currently working on a plug-in for Eclipse that translates some custom Java code
I am currently working on a project where a team of us are designing
I am currently working through the tutorial on Django's website. Upon completing the following
I'm currently working through the notepad tutorial, and exercise 2 completes the code to
I am working on a project that needs to use a database driven MVC
I've been following this tutorial. I'm working with WebFaction. The difference to be noted,
I am busy working on a project that needs a REST API to allow

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.