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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:12:22+00:00 2026-05-23T15:12:22+00:00

I have an iOS project which builds and executes as expected under debug yet

  • 0

I have an iOS project which builds and executes as expected under debug yet throws a compilation error when being built for release. The error is to do with an iVar which is declared in a superclass and it is specifically

'fetchedResultsController_' undeclared (First use in this function).

Here is the superclass .h.

@interface Super : UIViewController <NSFetchedResultsControllerDelegate> {
    NSFetchedResultsController* fetchedResultsController_;
    NSManagedObjectContext* managedObjectContext_;
}

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

@end

and the superclass .m

@implementation Super

@synthesize fetchedResultsController = fetchedResultsController_;
@synthesize managedObjectContext = managedObjectContext_;

#pragma mark -
#pragma mark Properties

-(NSFetchedResultsController*)fetchedResultsController {
    return nil;
}

The Subclass interface is defined thus:-

@interface Sub : Super <UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate> {
    // extra stuff
}

In the subclass .m I implement lazy loading for fetchedResultsController

-(NSFetchedResultsController*)fetchedResultsController {

    if (fetchedResultsController_ == nil) { // undeclared error here....
    //stuff
    }
    return fetchedResultsController_;

I’m confused mainly because I don’t understand why this would comile in Debug but not in Release!

If someone could identify what the issue is I’d appreciate it greatly

  • 1 1 Answer
  • 3 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-23T15:12:23+00:00Added an answer on May 23, 2026 at 3:12 pm

    This isn’t the answer to your question, but it will make the problem go away.

    As things stand, in your Super class, having the instance variable at all is pointless. And you should probably set the property readOnly so people using it know that setting the fetchedResultController property is not allowed. As things stand, people have a reasonable expectation that if they set the property, they’ll get more something back when they read it.

    So, move the instance variable into the subclass. Declare the property readOnly in the superclass and redeclare it readWrite in the subclass.

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

Sidebar

Related Questions

I have encountered an unexpected Access Error while running a project I've built using
I have a iOS project in which I am using ARC in my own
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have an iOS app project in Xcode 4.2. I also have a shell
I have a workspace with a project which links with the static libraries in
I have 2 separate iOS projects in xcode 4. One is APP which is
I have an iOS project that sends a Person class with one attribute name
I'm working on my iOS project again. However, I seem to have hit a
i've implemented this OpenCV build into my iphone project: http://aptogo.co.uk/2011/09/opencv-framework-for-ios/ It builds successfully and
I have a project which downloads images in background using NSOperationQueue . It was

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.