すべての UITableView に影の効果を作成するためのカスタム UITableView クラスがあります。テーブル ビュー コントローラーごとに nib ファイルを作成せずに、このクラスを UITableViewController に組み込むことは可能ですか? このカスタム UITableView を IB 以外にリンクする別の方法はありますか?
1 に答える
1
UITableViewController を使用して、カスタム UITableView のデリゲートとデータソースをコントローラーに設定し、そのカスタム tableView インスタンスを UITableViewController の tableView プロパティとして設定します。
[instanceOfMyCustomUITableView setDelegate:self];
[instanceOfMyCustomUITableView setDataSource:self];
[self setTableView:instanceOfMyCustomUITableView];
self は UITableViewController のインスタンスです
于 2010-10-08T00:25:02.443 に答える