XIB
ファイルTimerCell.xibとUITableViewCell
があります。私は2つのUILabel
と1 UIButton
を持っている私のTimerCellでUITableViewCellでUIButtonのアクションを設定する方法
static NSString *CellIdentifier = @"cellTimer";
TimerCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
//cell = [[TimerCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"TimerCell"owner:self options:nil];
cell = [nib objectAtIndex:0];
:cellForRowAtIndexPath内の他のクラスでは、私はこのUITableViewCell
を初期化します。このボタンについては、アクションをいくつかの方法に設定したいと思います。
どうすればいいですか?そして、最初のUILabel
のバックグラウンドカウントダウンタイマーのデータをリアルタイムに表示するにはどうすればいいですか?
それは働きます!ありがとうございました!!これでタグを設定する方法は?それ以前は** cell.staticButton.tag = indexPath.row; ** – Romowski
私の編集した回答をチェック@Romowski – Dany