0

アプリケーションでa を使用し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

UITableView の上に searchBar を追加し、searchBar の SearchButtonClicked デリゲートを使用して検索機能を実装します。たとえば、ユーザーがキーワードを検索した場合、クラスの searchBarButtopnClicked デリゲートで searchBar.text によってキーワードをキャッチします。その名前を Array (そこから UITableView に入力している) に検索します。検索したキーワードに似たオブジェクトが見つかった場合は、UITableView をリロードします。

于 2013-04-30T13:02:51.380 に答える