NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds for empty array'

前端 未结 5 943
抹茶落季
抹茶落季 2020-12-16 20:32

in my application when i run app for first time,it work ok.but when i run again 2 two times, it crashes.

This is the error..

NSRangeException\', reason: \'**

5条回答
  •  长情又很酷
    2020-12-16 20:46

    In case this helps someone : in my case the array was not in code, but an IB outlet that was an array of 5 UIImageViews in the storyboard.

    @IBOutlet var upAndDownArrowImages: [UIImageView]!

    Reason for the crash was that I mistakenly deleted 1 of those UIImageViews from the Storyboard.

提交回复
热议问题