开发者

What does Expected specifier-qualifier-list mean in Xcode/Objective-C?

开发者 https://www.devze.com 2023-02-28 08:15 出处:网络
I keep getting this error: Expected specifier-qualif开发者_如何学Cier-list before \'(\' token, on these 2 lines:

I keep getting this error: Expected specifier-qualif开发者_如何学Cier-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


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)...

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UIViewController *hvController;

and then (somewhere in your .m file)...

@Implementation YourClassName
@synthesize window, hvController;

and then (later in your .m file)...

 - (Void)dealloc {
     [hvController release];
     [window release];
     [super dealloc];
 }

..with lots of other stuff in-between.

...but please get a book or some online tutorials and start with something simpler!

0

精彩评论

暂无评论...
验证码 换一张
取 消