1
votes

this is login.m

#import 


@interface login : UIViewController {
    IBOutlet UITextField *UserName;
    IBOutlet UITextField *PassWord;
    IBOutlet UIActivityIndicatorView *LoginActivity;
}
@property (nonatomic, retain) IBOutlet UITextField              *UserName;
@property (nonatomic, retain) IBOutlet UITextField              *PassWord;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView  *LoginActivity;
- (IBAction) doLogin:(id)sender;

@end

and this login.h


#import "login.h"

@implementation login

@synthesize UserName,PassWord;

- (IBAction) doLogin:(id)sender {
    [ PassWord resignFirstResponder ];
    [ LoginActivity startAnimating ];
    NSLog(@"%@ / %@", [ UserName text ], [ PassWord text ] );
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}
- (void)dealloc {
    [super dealloc];
}
@end

if i press login(dologin) i got this error -[ViewAController doLogin:]: unrecognized selector sent to instance

1
As an unrelated tip, class names,like "login", should be capitalized (Login) and variable names, like "UserName", shouldn't (userName). It makes the code easier to read if if follows standards.Terry Wilcox

1 Answers

2
votes

It looks like you've named the class "login", but have hooked up the button to an instance of "ViewAController". ViewAController doesn't have a doLogin: method?