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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:39:49+00:00 2026-06-06T00:39:49+00:00

My app has been under dev for a few months and am now being

  • 0

My app has been under dev for a few months and am now being asked to add Core Data. SMH. It is a tabViewController app. I don’t know if that helps with the answer.

So here I am trying to add it and i’m getting errors. I build for Core Data in the AppDelegate.h, so I have created these IVARs and build them appropriately later in the .m.

@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;

In the viewControllers that need CoreData interaction, I have given them (in the .h files):

@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;

and synthesized them in the .m:

@synthesize fetchedResultsController = __fetchedResultsController;
@synthesize managedObjectContext = __managedObjectContext;

Now, back to the AppDelegate. In the .m, when I try to pass the pointer for the managedObjectContext from the delegate to the views (like so):

viewController1.managedObjectContext = self.managedObjectContext;
viewController2.managedObjectContext = self.managedObjectContext;

I am getting an XCode Error that reads (for both viewController1 and 2):

Property 'managedObjectContext' not found on object of type 'UIViewController *'

I don’t understand this because the property in both View Controllers clearly exists and is synthesized.

I’ve even tried quitting and restarting XCode. Maybe a system reboot? <– Is that absurd??

(I know I have added more than you may need..) Any help?

  • 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-06T00:39:50+00:00Added an answer on June 6, 2026 at 12:39 am

    I found this answer on another post:

    “An alternative approach is to pull the context from your app delegate – at the moment the app delegate has to be re-coded if you change the way your app is organised. You can get a pointer to the app delegate anywhere, so the following piece of code can be added to any view controller:

    AppDelegate *delegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];  
    self.managedObjectContext = delegate.managedObjectContext;
    

    Usually in the viewDidLoad.”

    Thank you to user: jrturton for the answer

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

Sidebar

Related Questions

my iPhone app has been approved and I am ready to add push notifications
I've been using sqlite3 for my database under development and my app has gotten
I have a little app that has been under development for some time. My
My app has been written for SDK 1.5 3.0 but when it is running
My web app has been chugging along just great in Production for years with
How can i find out if a C# App has been started from the
Is there a way to get a system notification when an app has been
I want to submit an app to the app store. The app has been
I have a Windows Form application. Version 1 of my app has been released
I've developed an iPhone app that has been running MPMoviePlayer (pre 3.2 SDK) with

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.