I have contact form in my application in that i need to validate the email id i have found some solution for validating the email id but when used the validation method its showing warning.
@synthesize mail;
email validation code:
-(BOOL) Emailvalidate:(NSString *)mail
{
BOOL stricterFilter = YES;
NSString *stricterFilterString = @"[A-Z0-9a-z\\._%+-]+@([A-Za-z0-9-]+\\.)+[A-Za-z]{2,4}";
NSString *laxString = @".+@([A-Za-z0-9]+\\.)+[A-Za-z]{2}[A-Za-z]*";
NSString *emailRegex = stricterFilter ? stricterFilterString : laxString;
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
return [emailTest evaluateWithObject:mail];
}
In the return its showing the warning like
Local declaration of mail hides instance variable.
I am sending all the date's to my server using the JSON
please tell me how to resolve this one.