In My app i need to post the value of uitextfield as soon as user enter the fourth character. how can get the value of uitextfield when the user enter the fourth character. Can any one tell me how can i do it?
Asked
Active
Viewed 761 times
1
-
That page requires you to complete a spammy survey. – Matthew Frederick Jan 07 '11 at 05:14
-
Check this [answer](http://stackoverflow.com/q/433337/1603234) – Hemang Jan 30 '13 at 08:59
2 Answers
0
u can use UITextField delegate method -
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
it calls whenever user enter char ..

iOSPawan
- 2,884
- 2
- 25
- 50
0
Set the UITextField's delegate to the view controller/file's owner and use the textViewDidChange delegate method.
- (void)textViewDidChange:(UITextView *)textView {
if ([textView.text length] == 4) {
// Your post action goes here, with the value being textView.text
}
}

Matthew Frederick
- 22,245
- 10
- 71
- 97