// ViewController.h
@interface ViewController : UIViewController{
IBOutlet UIButton *btnname;
IBOutlet UITextView *txtname;
IBOutlet UILabel *lblname;
}
@property (retain, nonatomic) IBOutlet UITextField *txtname;
@property (retain, nonatomic) IBOutlet UILabel *lblname;
- (IBAction)Btntikla:(id)sender;
@end
//ViewController.m
@implementation ViewController
@synthesize txtname;//here it says -type of property txtname (uiTextView *) does not match of ivar txtname(uiTextView)- this mistakes
@synthesize lblname;
- (void)dealloc {
[lblname release];
[txtname release];
[super dealloc];
}
- (IBAction)Btntikla:(id)sender {
NSString *name=[txtname text];
lblname.text=name;
}
@end
//my whole program is this.it gives this error?type of property txtname (uiTextView *) does not match of ivar txtname(uiTextView)..Can you help me pls?? what is my mistake ?
That’s beacause you have
and
And
UITextFieldandUITextVieware differents controls