【问题标题】:UITableView reload sections crashesUITableView 重新加载部分崩溃
【发布时间】:2016-07-11 05:04:18
【问题描述】:

我正在使用[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:k] withRowAnimation:UITableViewRowAnimationNone];,我检查了我得到了一个有效的 k 值,但我仍然得到了-[NSIndexSet initWithIndexesInRange:]: Range {9223372036854775807, 1} exceeds maximum index value of NSNotFound - 1

【问题讨论】:

    标签: ios objective-c uitableview reloaddata nsindexset


    【解决方案1】:

    试试下面的代码可能对你有帮助

    NSRange range = NSMakeRange(0, 1);
    NSIndexSet *section = [NSIndexSet indexSetWithIndexesInRange:range];                                     
    [self.tableView reloadSections:section withRowAnimation:UITableViewRowAnimationNone];
    

    【讨论】:

    • 感谢重播,但我想知道代码保持不变,您能解释一下为什么会这样吗?
    • 在给出负率和磨损规格并阅读之前,我只是说尝试过阅读粗体文本,我并不是说它会起作用。
    猜你喜欢
    • 2015-01-01
    • 1970-01-01
    • 2011-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-09
    相关资源
    最近更新 更多