I am creating one form I want to check in Name Field if any one enter Number then show alert.
Here is the code:
NSString *str = abc.text;
NSCharacterSet *alphaSet = [NSCharacterSet alphanumericCharacterSet];
BOOL valid = [[str stringByTrimmingCharactersInSet:alphaSet] isEqualToString:@""];
if (!(valid))
{
NSLog(@"number present");
}
else
{
NSLog(@"number not present");
}
Thanks
}
Used this code and add delegate to your UItextfield I hope it work for you