0

UITableView在我的应用程序中使用了一个。在那,而不是 default UITableView,我使用了一个组合使用UILabels.

我有一个对象列表,在每个表格行中我有 6 个标签,例如:

1st label --Customername 
2nd label --Curresponding customername of the object
3rd label --CustomerID
4th label --Curresponding customeID of the object
5th label --Description
6th label --Curresponding description of the object

在这种情况下,我如何实现特定条件的搜索方法,比如说CustomerName

4

1 回答 1

0

Add a searchBar on top of UITableView , and using the SearchButtonClicked delegate of the searchBar implement the searching functionality , example if user searched for any keyword , you catch the keyword by searchBar.text in the searchBarButtopnClicked delegate in your class . Now search that name into the Array (from which you are populating the UITableView ) . If you found any object resembling with the searched keyword reload the UITableView else give a UIAlertView that "No Item Matched"

于 2013-04-30T13:02:51.380 回答