bug

作者: whereandhere | 来源:发表于2019-03-05 17:48 被阅读0次

数字精确度 转换
xib视图有时隐藏,错误认为怎么都加不上,还有 tf 是否可输入,view 是否可交互,父视图 height是否足够 仔细注意一下之前复制的控件属性
定义参数名 不能使用苹果关键字,比如 class new id
数组是一个 对象类型 该用strong 修饰,让我写成 修饰 非对象类型 用的 assign 注意⚠️ 一定要仔细
使用 sd_layout布局时,代码,子视图要加在self.contentView上!!,如果加在self上 ,方法会去找 xib,找不到就崩溃 「
[_modelTableview registerClass:cellClass forCellReuseIdentifier:NSStringFromClass(cellClass)];
self.modelCell = [_modelTableview dequeueReusableCellWithIdentifier:NSStringFromClass(cellClass)];
if (!self.modelCell.contentView.subviews.count) {
self.modelCell = nil;
[_modelTableview registerNib:[UINib nibWithNibName:NSStringFromClass(cellClass) bundle:nil] forCellReuseIdentifier:NSStringFromClass(cellClass)];
self.modelCell = [_modelTableview dequeueReusableCellWithIdentifier:NSStringFromClass(cellClass)];
}

」使用 sd_layout布局时,代码,子视图要加在self.contentView上!
UICollectionView
cell的数据源为空,但仍要返回1个时,也要赋值,不然会cell重用取其他的值会错误❌
(找错误来源)
cell的 height一定要 到 底部。不然 最下面button就点击不动
file ->project settings -> Legacy Build System
tableView
数据源 dataArray 注意初始化
设置footview 为 nullview时,有数据就应该隐藏nullview

当tableView有数据时返回个数,不然会显示占位

  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    //当有数据时
    if (section == 0 && self.modeldet) {
    return 1;
    }
    if (section == 1 && self.modeldet) {

      return 1;
    

    }
    return self.arrStep.count ;
    }

相关文章

网友评论

      本文标题:bug

      本文链接:https://www.haomeiwen.com/subject/nmbouqtx.html