search

Home  >  Q&A  >  body text

ios - collectionView刷新局部单元格,程序崩溃,

需求是得到一个对象刷新到collectionView上

崩溃信息

大家讲道理大家讲道理2891 days ago654

reply all(3)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:47:32

    Your picture has not been requested yet, so I left. You can first determine whether the image exists or is an array? If it is empty, continue execution

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:47:32

    There is a problem with indexPath. Please output the NSLOG first and try again after adjusting the NSIndexpath

    reply
    0
  • PHPz

    PHPz2017-04-17 17:47:32

    After you add result object, it is at the last position of the array and is not the position you want to replace, and the index is greater than the number of cells, so it crashes. Just use replaceObjectAtIndex: withObject: and it will be fine.

    reply
    0
  • Cancelreply