iphone - How to obtain the actual string like it is displayed in the UITextField while the user is typing? -
The UITextFieldDelegate Protocol, which provides only one appropriate method to notify changes in UITextField:
(NSString *) string
This method does not provide the actual string as - (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange ) It appears in textField. It is called text property before before in uteadfeld updates.
string
has just changed.
The only way I can find out is to gather the text manually with this information. How would I go about this? Should I invent solutions or already have one?
You may not need a representative method. / P>
If you are using IB, then you can create an IBAction like this
- myTextFieldDidChange: (ID) sender {/ NSString * aString = MyTextField Just join this function with ValueChanged (UIControlEventValueChanged) for events related to your respective UITextField (in this case, myTextField)
/ Html>
Comments
Post a Comment