【发布时间】:2011-10-03 07:34:21
【问题描述】:
我有一个简单的课程:
#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' undeclared (first use in this function)`
这里有什么问题?
【问题讨论】:
-
P.S.:
self->_fetchedResultsController工作... -
如您所见,添加
self->有效。我还听说切换到 LLVM 可以让它在没有它的情况下工作,documentation 似乎表明它应该这样做。 -
ughoavgfhw,请写下您的评论作为答案 - 您的建议对我有帮助(我已将
C/C++ Compiler Version更改为LLVM compiler 2.0),我想将其标记为正确且关闭的问题。
标签: objective-c ios inheritance protected