Hi,
In order to verify an email address you have entered is valid or not using Objective C, use the following code.
- (BOOL) checkYourMail: (NSString *) myEmail{ NSString *checkMail= @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}"; NSPredicate *matchMail = [NSPredicate predicateWithFormat:@"Matching %@", checkMail]; return [matchMail evaluateWithObject:myEmail]; }
🙂
Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Unable to parse the format string “Matching%@”
iam getting this error when i run ur code
can any 1 confirm this code is running fine or with error??
it still gives an error
NSPredicate * matchMail = [NSPredicate predicateWithFormat:@”SELF MATCHES %@”, checkMail];
I think it will work….