how to validate a username and password using textFieldDidChange using objective c? : -(void)select
{
    
    NSString *sql1= [NSString stringWithFormat:@"SELECT * FROM sample"];
    
    sqlite3_stmt *statement;
    if( sqlite3_prepare_v2(db, [sql1 UTF8String], -1, &statement, NULL) == SQLITE_OK )
    {
        while( sqlite3_step(statement) == SQLITE_ROW )
        {
            
            char *field1=(char *)sqlite3_column_text(statement,0 );
            NSString *field1Str=[[NSString alloc]initWithUTF8String:field1];
            NSLog(@"The string value is %@ ",field1Str);
            char *field2=(char *)sqlite3_column_text(statement,1 );
            NSString *field2Str=[[NSString alloc]initWithUTF8String:field2];
            NSLog(@"The string value is %@ ",field2Str);
            [self.usertext1 addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];

            -(void)textFieldDidChange :(UITextField *)_usertext1{
               
            if([_usertext1.text isEqualToString:field1Str]&&[_passtext2.text isEqualToString:field2Str])
            {
                _outbutton.enabled="YES";            }
            else
            {
                _outbutton.enabled="NO";
            }
            
        }
        }}

}
 
I am new to iOS programming..I have tried above code for validating username and password while user will type ....I don't no how to use  textFieldDidChange and forControlEvents:UIControlEventEditingChanged...I just want to make my login page more secure and efficient...If I type correct values or wrong value the controll goes to next page ....how can I validate plz help me....
