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

  • Home
  • SEARCH
  • 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 6383119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:36:34+00:00 2026-05-25T02:36:34+00:00

The code generated by Xcode when creating a navigation based application which uses core

  • 0

The code generated by Xcode when creating a navigation based application which uses core data declares fetchedResultsController_ as private

@private
    NSFetchedResultsController *fetchedResultsController_;
    NSManagedObjectContext *managedObjectContext_;

Some one please explain whether there is a reason to declare it as private?

I intends to create a CommontableViewController and subclass it to use in a tab bar application with five tabs. Is there any issues if I remove the private declaration and make it protected. My compiler does not give any warning, but I am worried about the data integrity.

  • 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-25T02:36:35+00:00Added an answer on May 25, 2026 at 2:36 am

    I believe the template also adds @property declarations for those two variables; is that correct? If so, your subclasses should use self.fetchedResultsController and self.managedObjectContext instead of accessing the variables directly. That way you can maintain encapsulation and keep the variables private.

    The point of having them be private is that only the superclass should be responsible for setting up the storage for those objects; subclasses can just use the getter methods when they want to use them. Of course, nothing would burst into flame if you decided to make them protected, but I don’t think there’s a real need to.

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

Sidebar

Related Questions

I am writing an iPhone app which uses core data for storage. All of
This is my GeneratedCode for Core data, automatically generated by xCode Editor. #import <Foundation/Foundation.h>
I've choosen the view-based application template in Xcode. The myProjectViewController.m has the following code:
Are there are good uses of Partial Classes outside the webforms/winforms generated code scenarios?
Code auto-generated by Xcode seems to have the opening brace on the same line
I have an iphone app that uses Core Data to do storage. I have
If I create a New Project in xcode, then choose View-based Application, the delegate
I have looked at the sample generated by xcode when creating a new UISplitView
I've recently created a project using Core Data. I checked where xcode ask you
Can I use the code generated by flex/bison|lex/yacc in a multithreaded environment ? I'm

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.