Xcode/Objective-C 中预期说明符限定符列表是什么意思?
我不断收到此错误: Expected specifier-qualifier-list before '(' token, on this 2 line:
@property (nonatomic, retain) (@Implementation window, hvController;
-(void)dealloc ;@property (nonatomic, retain){
PS 删除 ( 只会使问题变得更糟
I keep getting this error: Expected specifier-qualifier-list before '(' token, on these 2 lines:
@property (nonatomic, retain) (@Implementation window, hvController;
-(void)dealloc ;@property (nonatomic, retain){
P.S. removing the ( only makes the problem worse
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这有点像火车失事,但我看到你是新人(就像我们都曾经一样),所以我会尝试&提供更多帮助...
出现更多错误并不意味着您的问题更糟。您只是看不到新的错误,因为旧的错误挡住了您的视线。所以杀掉那个讨厌的“(”。
@property可能最好放在你的头文件中,但无论如何它后面应该跟着你想要成为属性的东西的类型和名称,并且你也需要一个@synthesize 然后
您的代码应该看起来更像这样(在您的 .h 文件中的某个位置)...
然后(在您的 .m 文件中的某个位置)...
(稍后在您的 .m 文件中)...
..有很多介于两者之间的其他东西
......但是请获取一本书或一些在线教程并从更简单的东西开始!
This is a bit of a train wreck, but I see you're new (as we all were once) so I'll try & be a bit more helpful...
Getting more errors doesn't mean your problems are worse. You just couldn't see the new errors because the old one was in the way. So Kill that pesky '('.
The @property is probably better off in your header file, but anyway it should be followed by the type and name of the thing you want to be a property, and you need a @synthesize for it too.
Your code should look more like this (somewhere in your .h file)...
and then (somewhere in your .m file)...
and then (later in your .m file)...
..with lots of other stuff in-between.
...but please get a book or some online tutorials and start with something simpler!