#import <UIKit/UIKit.h>
@interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
{
IBOutlet UITextField *txtname;
IBOutlet UITextField *txtpassword;
}
@property (nonatomic, retain) IBOutlet UITextField *txtname;
@property (nonatomic, retain) IBOutlet UITextField *txtpassword;
-(IBAction) mylogin;
-(IBAction) makeKeyBoardGoAway;
@end
Add following code in .m file
- (IBAction) mylogin
{
if ([txtname.text isEqualToString:duName] && [txtpassword.text isEqualToString:dpassword])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Suucessfull Logi...."
message:@"Welcome.!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
}
else{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Login Fail...."
message:@"Username OR Password Incorrect.!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
}
}
-(IBAction) makeKeyBoardGoAway{
[txtpassword resignFirstResponder];
}
Aslo want create UI and match the components with File Owner......