たとえば、ときに、セットアップあなたの細胞を、その後、カスタムのUITableViewCellとセットアップ2つのボタンを作成:あなたの**質問what's
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier" forIndexPath:indexPath];
// Configure the cell...
cell.likeToggleButton.selected = NO; //--> should be based on your settings
[cell.likeToggleButton addTarget:self action:@selector(toggleAction:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
- (void)toggleActio:(UIButton *)sender {
UITableViewCell *cell = (UITableViewCell *)[sender.superview superview];
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
if (sender.selected) {
// perform your dislike action based on button indexPath
sender.selected = NO;
}else {
// perform your like action based on button indexPath
sender.selected = YES;
}
}
を**? ;-) –
これはここです:どのように私は愛のためのボタンを作成することができます/テーブルビューで項目をunlove:| –
@カイルーああ、申し訳ありません、今私はそれを参照してください... –