我有一个简单的类:
#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>
@interface MyTableViewController : UITableViewController
{
@protected
NSFetchedResultsController *_fetchedResultsController;
}
还有一个:
#import <UIKit/UIKit.h>
@interface MyChildTableViewController : MyTableViewController
{
}
- (void)someMethod;
问题是我无法在 MyChildTableViewController
类中使用 _fetchedResultsController
。我收到编译时错误:'_fetchedResultsController' 未声明(首次在此函数中使用)`
这里有什么问题吗?
最佳答案
ughoavgfhw在评论中发布正确答案。我已经要求他(也在评论中)将其重写为答案 - 所以我可以接受。但他没有。所以我会发布我自己的答案,只是为了关闭问题并将其从未回答中删除。
解决办法:
在项目设置中将 C/C++ Compiler Version
更改为 LLVM compiler 2.0
。
关于objective-c - @protected 在 Objective-C 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6659383/