TodayExtension UITableViewCell没有出现在64位设备上

时间:2016-12-01 12:39:33

标签: ios objective-c iphone uitableview

我正在开发一个具有带有UITableView和一些单元格的TodayExtension的应用程序。该扩展程序在较旧的设备上运行良好,但它不适用于较新的设备/模拟器。我认为它可能与它们是64位而不是32位这一事实有关。

我遇到的确切问题:即使调用了所有委托方法,UITableViewCell也没有出现。我将它们打印出来,它们的表现与预期完全一致。 UITableView出现在Extension而不是单元格上。

代码:

-(LifestyleWidgetTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    LifestyleWidgetTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"lifestyleTableViewCell"];

    [cell.widgetCollectionView reloadData];
    [cell setUserInteractionEnabled:YES];
    [cell setSelectionStyle:UITableViewCellSelectionStyleDefault];

    return cell;
}

-(float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 125;
}

-(int)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [[WidgetManager getInstance] getAllWidgetsOfType:LifestyleWidget].count + 1;
}

即使尺寸正在调整,因为它应该添加更多的细胞等。只是没有内容出现...这让我完全难过,如果有人可以帮助我在这里,将非常感激。

(是的,我在构建体系结构中的arm64包含应用程序和扩展程序)

1 个答案:

答案 0 :(得分:0)

好吧我明白了,在64位设备上,返回一个浮点数来表示TableViewCell的高度而不是CGFloat是一个问题。 UITableViewCells的高度为0,这使得它似乎无法正常工作。我一直忽略了警告,我的错误。

相关问题