I need to validate an email address which was in the format dsfdsf@.fdsf.com
As I am new I dont know how to validate the email address.
Please suggest me how to get out of this.
I need to validate an email address which was in the format dsfdsf@.fdsf.com
As I am new I dont know how to validate the email address.
Please suggest me how to get out of this.
 
    
     
    
    there you will find the answer :-) What are best practices for validating email addresses in Objective-C for iOS 2.0?
NSString *emailRegEx = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx];
if ([emailTest evaluateWithObject:userMailTextField.text] == YES)           
{
   //---- Code for action do you want
}
else
{
   UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Message" message:@"Email id is not in proper format" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
   [alert show];
}
 
    
    Same way you validate it in any language: examine the string directly, use a regex, etc.
Do some google searches on email validation first though. You'll find it's an area that's incredibly difficult to get right.
