EXC_BAD_ACCESS Crash in UITableView when number of rows is 0

限于喜欢 提交于 2019-12-04 07:56:13

Turns out that I forgot to return a table cell in a previous initialization function. All fixed now.

well that's because

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

cannot return 0 That's because UITableview cannot draw an empty table without any cell

so

    if (m_oPositionItems == nil)
    return 1;
else
    return [m_oPositionItems count];

should do the trick.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!