@protected in Objective-C
I have a simple class:
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface MyTableViewController : UITableViewController
{
@protected
NSFetchedResultsController *_fetchedResultsController;
}
And one more:
#import <UIKit/UIKit.h>
@interface MyChildTableViewController : MyTableViewController
{
}开发者_运维问答
- (void)someMethod;
The problem is that I can't use _fetchedResultsController
in MyChildTableViewController
class. I get compile-time error: '_fetchedResultsController' undeclared (first use in this function)`
What's wrong here?
ughoavgfhw posted right answer in comments. I've asked him (in comments, also) to rewrite it as an answer - so I can accept it. But he didn't. So I will post my own answer, simply to close the question and remove it from unanswered.
The solution:
Change C/C++ Compiler Version
to LLVM compiler 2.0
in your project's settings.
I also had the same problem, by using self->, everything worked fine.
精彩评论