I have a simple question and that is how do you check if an email exists
I have seen this code on a recent post:
- (BOOL) NSStringIsValidEmail:(NSString *)checkString{
BOOL stricterFilter = YES;
NSString *stricterFilterString = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSString *laxString = @".+@.+\\.[A-Za-z]{2}[A-Za-z]*";
NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
return [emailTest evaluateWithObject:checkString];
}
My question is, how do I return an action if the BOOL returns YES or NO with an NSTextField?
Simply have a label and set the text of the label to an appropriate message if the email is correct or not.
You can run your checking routine every time the user types a new character into the text field by implementing the following
UITextFieldDelegateprotocol method: