と の XIB がUITableView
ありUITableViewCell
ます。
このセルをcellForRowAtIndexPathの tableView に接続するにはどうすればよいですか?
編集済み
編集済み
このセルの上にあるtableViewの画面のセルを使用したいだけです。ラベルを 1 つだけ表示する必要があるため、クラスを作成したくありません
みんなに感謝
と の XIB がUITableView
ありUITableViewCell
ます。
このセルをcellForRowAtIndexPathの tableView に接続するにはどうすればよいですか?
編集済み
編集済み
このセルの上にあるtableViewの画面のセルを使用したいだけです。ラベルを 1 つだけ表示する必要があるため、クラスを作成したくありません
みんなに感謝
デリゲートとデータソースを tableviewView に設定する必要があります。
それは2つの方法で作ることができます。
1) ビュー コントローラーが UITableViewController の場合は、TableViewDatasource を見つけて xib にデリゲートし、ファイルの所有者にタグ付けします。
2) それ以外の場合 UIViewController を使用する場合..
あなたの.hファイルで
@interface YourViewController<UITableviewDelegate,UITableviewDatasource>
ビューでDidload。
self.tableView1.delegate = self;
self.tableView1.datasource = self;
static NSString *cellIdentifier = @"currencyCellIdentifier";
// Try to retrieve from the table view a now-unused cell with the given identifier.
CurrencyTableCell *cell = [tableView1 dequeueReusableCellWithIdentifier:cellIdentifier];
// If no cell is available, create a new one using the given identifier.
if (cell == nil)
{
// Use the default cell style.
cell = [[CurrencyTableCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CurrencyTableCell"
owner:self options:nil];
cell = [nib objectAtIndex:0];
}