在UITableViewCell中获取它的父视图

来源:互联网 发布:梦里花落知多少抄袭 编辑:程序博客网 时间:2024/05/18 02:00
-(void)goBtnLabel2Action:(UIButton *)sender
{
    BMKPoiInfo *poiModel;
    if ([sender.superview.superview isEqual:self.av.hotTableView]) {
        poiModel = self.poiListArray[sender.tag];
    }
    else
    {
        poiModel = self.poiSmallArray[sender.tag];
    }
    NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",poiModel.phone];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

}

在IOS7以下系统,UITableViewCell.superview就是UITableView,但在IOS7中,cell上面还多了一个UITableViewWrapperView,所以需要UITableViewCell.superview.superview获取UITableView

0 0
原创粉丝点击