В итоге я использовал NSNumberFormatter для проверки правильности ввода вместо использования следующих методов:
+ (BOOL)validateNumeric:(NSString *)numericString {
NSString *regexExpression = @"^[-+]?\\d{0,9}$";
NSPredicate *matchTextPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexExpression];
return [matchTextPredicate evaluateWithObject:numericString];
}
ИЛИ
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
switch (fieldValidationType) {
case kValidationTypeAmount: {
NSCharacterSet *unacceptedInput = nil;
unacceptedInput = [[NSCharacterSet characterSetWithCharactersInString:CHARACTERS_AMOUNT] invertedSet];
if ([[self componentsSeparatedByCharactersInSet:unacceptedInput] count] > 1)
return NO;
else
return YES;
}
default:
return YES;
}
return YES;
}