I am trying to determine how to get UISearchBar
to delay calling textDidChange
till a few millisecs have passed. My goal is to aggregate multiple keyboard entries into one remote web service call.. As I have it now I call the server every keystroke and this is way too much.
If there is not some way within one of the UISearchBar
Delegate methods... is there some other way to accomplish the same goal... namely just do not call the server until the user has paused entering keys?
I have been using this delegate method:
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
Yes, you can use an NSTimer.
Do this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.