Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macfanboy

macrumors 6502a
Original poster
Jun 5, 2007
916
163
with this code, i get an error for each button in my header file. i dont see whats wrong. the error is

error: type of accessor does not match the type of property 'easy'.

i have five buttons and this error occurs five times; once for each button. i think ive read it thoroughly but i cant find my mistake. can anyone help me?

Code:
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface OneGameView : UIView {
	UIImageView *gameImage;
	NSTimer *gameTimer;
	NSUInteger time;
	UILabel *timerLabel;
	NSUInteger score;
	UILabel *scoreLabel;
	IBOutlet UIButton *pause;
	IBOutlet UIWindow *window8;
	IBOutlet UIView *newGameView;
	IBOutlet UIView *pauseView;
	IBOutlet UILabel *onePlayer;
	IBOutlet UIButton *easy;
	IBOutlet UIButton *medium;
	IBOutlet UIButton *hard;
	IBOutlet UIButton *back;
}

- (IBAction)pause;
- (IBAction)easy;
- (IBAction)hard;
- (IBAction)medium;
- (IBAction)back;
- (void)timer;
- (void)updateTimeLabel;

@property (nonatomic, retain) UIImageView *gameImage;
@property (nonatomic, retain) NSTimer *gameTimer;
@property (nonatomic, retain) UILabel *timerLabel;
@property (nonatomic, retain) UILabel *scoreLabel;
@property (nonatomic, retain) UIButton *pause;
@property (nonatomic, retain) UIWindow *window8;
@property (nonatomic, retain) UIView *newGameView;
@property (nonatomic, retain) UIView *pauseView;
@property (nonatomic, retain) UILabel *onePlayer;
@property (nonatomic, retain) UIButton *easy;
@property (nonatomic, retain) UIButton *medium;
@property (nonatomic, retain) UIButton *hard;
@property (nonatomic, retain) UIButton *back;

@end
 

johnnybluejeans

macrumors 6502
Jan 16, 2006
294
0
New York, NY
Your buttons and actions have the same name. You need to rename one of them.. for instance change your outlet definitions for your buttons to buttonEasy, buttonMedium.. etc.
 

Sbrocket

macrumors 65816
Jun 3, 2007
1,250
0
/dev/null
with this code, i get an error for each button in my header file. i dont see whats wrong. the error is

error: type of accessor does not match the type of property 'easy'.

i have five buttons and this error occurs five times; once for each button. i think ive read it thoroughly but i cant find my mistake. can anyone help me?

<snip>

Rename your methods to something else. My best guess is that the synthesized getters and setters for your properties are colliding with your methods.

Also, it should be "-(IBAction)methodName:(id)sender" not "-(IBAction)methodName".
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.