我有一个 XIB
文件,名称为 TimerCell.xib,其中包含一个 UITableViewCell
。在另一个类中的 cellForRowAtIndexPath 方法中,我初始化了这个 UITableViewCell
:
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];
在我的TimerCell中,我有两个UILabel
和一个UIButton
。对于这个按钮,我想设置action到某个方法。
我该如何做?如何实时显示来自后台倒计时计时器的数据在第一个UILabel
中?