美文网首页
attempt to insert nil object fro

attempt to insert nil object fro

作者: Helen_kay | 来源:发表于2016-12-05 16:55 被阅读0次

attempt to insert nil object from objects

试图从对象插入零对象

该错误出现的原因为对nil属性进行了操作

原因如下:

self.tagList.selectedArray.count <= 0

self.tagList.selectedArray数据源为nil

对nil进行了.count运算

解决问题心得:

解决该问题先找出出错的数组,该数组存在的含义,在哪儿用到,数组里面存放的什么东西。

debug调试是否为nil,为nil对数组做判断

解决方法:

if(self.tagList.selectedArray && self.tagList.selectedArray.count <= 0 )

1.  self.tagList.selectedArray先确定self.tagList.selectedArray不为nil

2.  再对self.tagList.selectedArray进行.count操作

相关文章

网友评论

      本文标题:attempt to insert nil object fro

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