Error message in XCode

Joined
Oct 18, 2008
Messages
6
Reaction score
0
Points
1
I followed a tutorial of XCode and I have got an error message of
error: 'disp_update' undeclared (first use in this function)
May I ask do you know how to solve this? Thanks in advance!!

--CounterController.m

#import "CounterController.h"

@implementation CounterController
- (IBAction)abutton_pushed:(id)sender {
count++;
[disp_upate setIntValue:count];
}

- (IBAction)mbutton_pushed:(id)sender {
count--;
[disp_upate setIntValue:count];
}

- (IBAction)pbutton_pushed:(id)sender {
count+=10;
[disp_upate setIntValue:count];
}
@end

--CounterController.h
#import <Cocoa/Cocoa.h>

@interface CounterController : NSObject{
IBOutlet id disp_update;
int count;
}
- (IBAction)abutton_pushed:(id)sender;
- (IBAction)mbutton_pushed:(id)sender;
- (IBAction)pbutton_pushed:(id)sender;
@end
 
Joined
May 2, 2009
Messages
480
Reaction score
13
Points
18
Your Mac's Specs
MBP 2.33 4GB: MacPro 8 Core 2.8, 16GB: MacMini 2.26 4GB: MacMin 2.53 4GB: iPhone3GS 32GB
You misspelled the 'dis_update' member in CounterController.m. In your implementation code you have it spelled as 'dis_upate'.
 
OP
F
Joined
Oct 18, 2008
Messages
6
Reaction score
0
Points
1
I am sorry, but I could not see where is the misspell, please advice. Thank you very much.
 
Joined
May 2, 2009
Messages
480
Reaction score
13
Points
18
Your Mac's Specs
MBP 2.33 4GB: MacPro 8 Core 2.8, 16GB: MacMini 2.26 4GB: MacMin 2.53 4GB: iPhone3GS 32GB
In your .h file you have declared

IBOutlet id disp_update;

In your .m file you are attempting to reference this member as

[disp_upate setIntValue:count];


dis_update and disp_upate are not the same thing. You need to change your .m file to reference

'disp_update'

your missing the 'd'
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top