实例变量在子类中不可用..?
我尝试过删除缓存、清理所有目标等。 根据我的配色方案,我的超类中的实例变量会突出显示为绿色,但编译器随后会失败,并提示“
"score" (or whatever) undeclared"
如果我在一个方法中有两个引用,则只有第一个引用失败”。如果我忽略它们,或者使用子类标头中的实例变量,则应用程序可以正常编译并运行。
就在两天前,它还可以正常工作。我想知道我是否不小心点击了打开某些奇怪设置的快捷方式?
如果这很重要的话,它正在 3.2 iPad 模拟器中运行。
这是一个奇怪的......希望有人以前遇到过这个。
I've tried removing cache, clean all targets, etc.
Instance variables from my super class are getting highlighted green according to my color scheme, but the compiler then fails saying
"score" (or whatever) undeclared"
If I have two references in one method, only the first one fails. If I leave them out, or use instance variables from my subclasses header, the app compiles and runs fine.
It was working literally just 2 days ago. I wonder if I accidentally hit a shortcut that turned on some weird setting?
It's running in the 3.2 iPad simulator, if that matters.
It's a weird one.. hope someone has run into this before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来你的实例变量被声明为@private。这意味着只有那个确切的类才能访问它们。如果你想让子类访问ivars,直接将@protected放在它们上面,例如
Sounds like your instance variables are declared as @private. This means that only that exact class can access them. If you want subclasses to access the ivars directly put @protected above them, eg