Ok, I've run into a small issue here. I'm trying to filter two things in my UITextField. They include limiting the number of characters and filtering the type of characters. I can get each one to work by there self but they both don't work together. It may have something to do with the double returns, idk. Hopefully someone can look at my code and see why they don't work together. I've beat myself up over this. Thanks for the help.
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSCharacterSet *svo;
svo = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS] invertedSet];
NSString *filtered = [[string componentsSeparatedByCharactersInSet:svo] componentsJoinedByString:@""];
BOOL bT = [string isEqualToString:filtered];
return bT;
if (myTextField.text.length >= MAX_LENGTH && range.length == 0)
{
return NO;
}
else
{
return YES;
}
}