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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:15:01+00:00 2026-05-14T19:15:01+00:00

In regards to XCode templates with CoreData enabled, I’ve read unclear use of @property

  • 0

In regards to XCode templates with CoreData enabled, I’ve read unclear use of @property in window app using core data which goes over the ‘what’ in the templates. But I am having an issue with the ‘why’. By declaring the category in the implementation file, the CoreData accessors act like private methods. The problem with that is whenever you want to use CoreData elsewhere in your app, you need some extra code.

I’ve figured you need to either supply your own method that exposes the managed object context, such as…

- (NSManagedObjectContext *)getManagedObjectContext
{
    return self.managedObjectContext;
}

…which will allow other parts of your app to use it.

Or you would need to jam pack your app delegate with specific methods to return managed objects, ie getProducts or setUser.

Can anyone shed light on the reasoning here?

  • 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-14T19:15:02+00:00Added an answer on May 14, 2026 at 7:15 pm

    The reason for this is because you should be using dependency injection in your designs. This is the recommended design by the Core Data team. What is expected is that your app delegate will set the NSManagedObjectContext reference in your root view controller(s). From there the controllers will set or inject the necessary dependencies in the following view controllers.

    This will lead to a more flexible design. I discussed it in depth in my article on the MDN (http://www.mac-developer-network.com/articles/cd0004.html).

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

Sidebar

Related Questions

I'm just investigating some memory leaks in my app, I'm using Xcode 4.0.2. I've
In regards to single-line textboxes (Multiline property is set to false), is it possible
In regards to: Find Hyperlinks in Text using Python (twitter related) How can I
This is in regards to merge XCode project.pbxproj files, but the same principle applies
In my mac, i am using XCode 4.2 with iOS 5 sdk and Mac
Xcode 3.2 kind of broke the build process of my iPhone app. I need
Is it possible to convert iphone application which is build using Xcode to Windows
Where can I find the View based application in Xcode 4, I'm using a
I'm using xCode 4, how can I add a view as shown in the
I have created a windows based project in XCode using IPhone as target platform

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.