سؤال

I have a UI table view with a search bar and it works well in normal case. Now the app may enter this screen with the search key word from the previous screen. When the screen is displayed, the keyword need be inputted in the search bar programmably and the table view need display the filtered the records as usual. Can anyone advise me how to implement this feature?

هل كانت مفيدة؟

المحلول

If you are using a UISearchDisplayController, you can grab its searchBar property (an instance of UISearchBar) and call setText: on the searchBar to set the text.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top