Reputation: 470
cocoa newbie here.
I try to take the input from keyboard and check it before it will be written on the nstextfield.
From searching i found keydown()
and NSFirstResponder
is what i need. But i cannot understand how to implement these things and generally how the thing with NSFirstResponder
works.
Can someone help me with an example or some sources please?
Upvotes: 1
Views: 462
Reputation: 50099
dont get the raw events in a textfield. instead implement this delegate in your controller:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
return NO or YES to dis-/allow that change
Upvotes: 0