I tested your code and it was working fine for me in iOS 7.1.
What you could try is:
Make your ViewController implement
<UITextFieldDelegate>
and set
textfield.delegate = self;
And implement the following function, which also always get called, whenever a character should be changed (even the last one). Make sure to always return YES if the character should be changed. With the range and textfield.text you can always access the current character to be changed:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
return YES;
}