I am using this function:
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)string
{
}
Inside the above function I want to check which textfield I am currently dealing with, can I put a check on on that particular textfield and secondly I want to compare say textfieldB.text when I end editing it (textfieldB) to another field say textfieldA.text, are the above two scenarios possible, I appreciate in advance for any help
If these are IBOutlets and declared in your interface then you can have if statements to check which textfield you are dealing with (i.e if(textField == textFieldA){doSomething;}
else if (textField ==…
Also if the textFieldA are tagged (you an tag them in interface builder) then you can have a switch statement to test each case.
Switch (textField.tag){…}.
You should also make you UIViewController class a “UITextFieldDelegate” and you can call a similar – (void)textFieldDidEndEditing… And make a similar comparison there.
I hope this helps