gpt4 book ai didi

ios - 单击时删除 UITableViewCells 按钮

转载 作者:行者123 更新时间:2023-12-01 18:14:56 26 4
gpt4 key购买 nike

我在 uitableview 单元格中有一个按钮 -

enter image description here

我已将其设置为在单击时触发 fmethod - (该函数显示消息并重置消息计数)。

我的这种方法的代码如下 -

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//Define Custom Cells

static NSString *CellCountI =@"CellCount";

UITableViewCell *cell;

feedData *f = [self.HpFeedArray objectAtIndex:indexPath.section];

//Comparison Strings
NSString *count = @"Count";

//If statement Cell Filters
//If Count Cell
if ([f.FeedGroup isEqualToString:count]) {

cell = [tableView dequeueReusableCellWithIdentifier:CellCountI forIndexPath:indexPath];

HP_Header_TableViewCell *hpTC = (HP_Header_TableViewCell *)cell;

hpTC.buttonPressedSelector = @selector(buttonImpMsg);

hpTC.buttonPressedTarget = self;

[hpTC.msgsBtn setTitle: f.FeedTitle forState: UIControlStateNormal];

return hpTC;
}
}

buttonImpMsg 方法如下 -
- (void)buttonImpMsg
{
NSLog(@"Back Button Pressed!");

[self removeBtn];
}

我想在单击时隐藏按钮 - 但我不确定如何从 buttonImpMsg 方法中引用它?

最佳答案

将发件人传递给选择器:-

- (void)buttonImpMsg:(id)sender { 
[sender removeFromSuperview];
}

关于ios - 单击时删除 UITableViewCells 按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22913978/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com