you can use an NSRegularExpression like so:
NSString *string1 = @"abc123";
NSString *string2 = @"!abc123";
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"[^a-z0-9]" options:NSRegularExpressionCaseInsensitive error:&error];
NSUInteger numberOfMatches = [regex numberOfMatchesInString:string1 options:0 range:NSMakeRange(0, [string1 length])];
NSLog(@"string 1 matches: %ld", numberOfMatches);
numberOfMatches = [regex numberOfMatchesInString:string2 options:0 range:NSMakeRange(0, [string1 length])];
NSLog(@"string 2 matches: %ld", numberOfMatches);
and change the pattern @"[^a-z0-9]" to suit the characters you want to check for. The ^ means "not in this set", so if any matches are found the field should fail validation.