如何在没有重用标识符机制的情况下获取故事板中定义的单元实例

时间:2016-12-01 10:21:40

标签: ios uitableview storyboard

我已经成功地在表数据源委托中获取了我的自定义UITableViewCell的实例(布局在storyboard单元原型中定义),这样:

<h:outputText value="#{v.maxWeight}" rendered="#{v != null and v.class.simpleName eq 'Lorry'}"/>

由于我的应用程序在表格视图中使用完全相同的单元格布局 ,我想从故事板中分配我的LeaderboardCell单元格的实例。我已经尝试过这个,但没有成功(它返回一个有效的实例,但没有连接插座):

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    LeaderboardCell* newCell = (LeaderboardCell*) [tableView dequeueReusableCellWithIdentifier:@"leaderboard_cell" forIndexPath:indexPath];
    return newCell;

}

我怎样才能做到这一点?

0 个答案:

没有答案