Email Validation based on domain
I want to know in COCOA, how can we validate email based on domain. For example, if i need that e开发者_如何学Gomail address entered on text field should be from apple.com (ex: abc@apple.com) only, means if anyone enter gmail.com (ex : abc@gmail.com), so it should be invalid email address.
Thanks.
NSString *email;
if (! [[email lowercaseString] hasSuffix:@"apple.com"]) {
// show error
}
Try a text entry field with a label next to it saying @apple.com
精彩评论