Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Mobile-Applications validate email objective c
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
validate email objective c
1 Answer(s)      3 years and 9 months ago
Posted in : MobileApplications


how can i validate email text field in objective c? is there any method that support multiple email address separated by coma.


Advertisement
View Answers

April 8, 2011 at 2:28 PM


- (BOOL)validateEmailWithString:(NSString*)email
{
    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 
    return [emailTest evaluateWithObject:email];
}

- (NSMutableArray*)validateEmailWithString:(NSString*)emails
{
    NSMutableArray *validEmails = [[NSMutableArray alloc] init];
    NSArray *emailArray = [emails componentsSeparatedByString:@","];
    for (NSString *email in emailArray)
    {
        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:email])
            [validEmails addObject:email];
    }
    return [validEmails autorelease];
}


Related Tutorials/Questions & Answers:
validate email objective c
validate email objective c  how can i validate email text field in objective c? is there any method that support multiple email address separated by coma.   - (BOOL)validateEmailWithString:(NSString*)email
objective c
objective c  how to minimize the uiview in widow effect in iphone sdk
Advertisements
how to validate the email login
how to validate the email login  // JavaScript Document JOIN US...; } } return true } function validate(){ var fname=document.form.fname.value; var lname=document.form.lname.value; var email=document.form.email.value; var
objective c subclassing tutorial
objective c subclassing tutorial  objective c subclassing tutorial
Catagories in Objective C
Catagories in Objective C  catagories in objective c   Categories in Objective C
logical operators in objective c
logical operators in objective c  logical operators in objective c
global variable in objective c
global variable in objective c  Declaring global variable in objective c
Struct in objective c example
Struct in objective c example  I am looking for a struct example in Objective C. Thanks
comparing dates objective c
comparing dates objective c  Comparing two different dates in Objective C.   if( [date isEqualToDate:otherDate] ) NSLog(@"%@ is equal to %@",date,otherDate);   Objective C NSString Date Example
Objective C Message Passing
Objective C Message Passing  What exactly a message passing means in Objective C? and how can i pass a message to a method
objective c boolean example
objective c boolean example  Hi, Can anyone tell me how to use boolean variable in Objective c? Thanks
@Protocols in Objective C
@Protocols in Objective C  Understanding @Protocols in Objective-C   @protocol in objective c @protocol is the keyword type in Objective C. Which is used to declare a formal protocol. You can find more Objective c
objective c if string equals
objective c if string equals   Checking if a string is equal to ' " '   In objective c, isEqualToString is a keyword that allows you to check if the string is equal to or not. if ([text isEqualToString
Parsing string in objective c
Parsing string in objective c  Hi, How can i parse a string in Objective c?? Thanks.   Parsing string in objective c This example will also help you to separate the strings separated by one component
objective c in iphone
objective c in iphone  how to minimize the uiview iin window effect in iphone..... rly me soon
retain count in Objective C
retain count in Objective C  what is the retain count in Objective C?   retainCount in Objective c retainCount: retain count method is used... of retainCount method here Objective C Memory Management Tutorial
Objective C Unichar example
Objective C Unichar example  A simple example of writing unichar in Objective C. Thanks.   An example that returns the value to every new line in the application. -(BOOL)NewLine:(unichar)c { if(c == '\n') return
Objective C resize UIImage
Objective C resize UIImage  i just want to resize the image on the touch detection. That means if a user double clicks on the UIImage it must resize the image
objective c is kind of
objective c is kind of  Hi, Provide me code of objective c is kind of method in objective c. I have to find if a view is kind of UIButton. Thanks   Hi, Here is code example: for(UIView *subview in [hScrollView
Why NSString Objective C
Objective C NSStrings is a class that deals with strings in objective c...". for example comparing strings in objective c if([statusString isEqualToString...Why NSString Objective C  Why we use the NSString class in Objective
objective c define float
objective c define float  Hi, How to define float variable in objective c? Thanks   Hi, Here is the example of defining float variable. float i; i=10; Thanks   Hi, Here is another example: // File
objective c pass by value
objective c pass by value   How to pass value by reference in objective c?   - (void)parentFunction { int i = 0; [self modifyValueOfPassedArgument:i]; //i == 0 still! } - (void)modifyValueOfPassedArgument
what is class methods in objective c
what is class methods in objective c  What is class methods in objective c? Explain the class method of objective c with the help of an example
what is class methods in objective c
what is class methods in objective c  What is class methods in objective c? Explain the class method of objective c with the help of an example
database application in objective c
database application in objective c  How to create a database application in XCOde
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
objective c extending a class with a class
objective c extending a class with a class  I need an example for extending a class with a class in objective c. thanks
iphone sdk-objective c
iphone sdk-objective c  how to delete random value which is got from the random function in an array
creation button using objective c
creation button using objective c  creation button using objective c
Validate email id in jsp - JSP-Interview Questions
Validate email id in jsp  Hi Please Suggest me how to validate email id in JSP(Java Server Faces
Validate Domain of an Email Id - JSP-Servlet
Validate Domain of an Email Id  How to validate the domain name in an Email id before sending a mail for an application using Mail API. ex: a@a.com in the above email id i want to validate whether a.com is present
Advertisements
 

 

 

DMCA.com