alibaba/wax

Crashed when setting text of custom cell

Closed this issue · 2 comments

-(RB_MoreOptionCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    RB_MoreOptionCell *cell = [tableView dequeueReusableCellWithIdentifier:RB_MoreOptionCellIdentifier];
    cell.lbl_detail.text = @"success";//No error
    return cell;
}
waxClass{"RB_SettingsVC", "RB_BaseVC", protocols = {"UITableViewDelegate", "UITableViewDataSource"}}

function tableView_cellForRowAtIndexPath(self, tableView, indexPath)
    local cell = self:ORIGtableView_cellForRowAtIndexPath(tableView, indexPath)
    local hehe = cell:lbl_detail()
    hehe:setText("xxx") // crashed!
    return cell
end

Crashed when setting text of cell:lbl_detail,

your method lbl_detail contains underline, which is special separator for method, so you can use UNDERxLINE instead of _.
like: cell:lblUNDERxLINEdetail()
document in https://github.com/alibaba/wax/wiki/Overview

passol1988 Can you help me use tableview with custom cell.
Thanks