已经搜索了一些可能的修复,但都没有解决我的问题.
我一直在点击uitableview中的单元格,而不是单击其中的按钮.
这是我的代码:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.backgroundColor = [UIColor blackColor];
UIView *v = nil;
NSArray *array = [cell subviews];
for (v in array) {
NSLog(@"%@",[v class]);
if( [v isKindOfClass:[UIView class]] ){
[v removeFromSuperview];
}
}
//tb
if (tableView == self.tb) {
v = [[UIView alloc] initWithFrame: CGRectMake(0, 0, self.tb.bounds.size.width, 120.0)];
if([feeds count]>0){
UIImageView *box=[[UIImageView …Run Code Online (Sandbox Code Playgroud)