Displaying images in sequence with a loop

前端 未结 4 1163
生来不讨喜
生来不讨喜 2020-12-21 08:41

I got an NSArray with 5 pictures. I want to display them one after the other in a loop. My code :

 NSArray *tabImage = [[NSArray alloc] init];

tabImage = [[         


        
4条回答
  •  余生分开走
    2020-12-21 09:26

    You don't print anything.

    You are overriding the contents of your pictoImage 20 times in a row, leaving it with the last assignment when var is 19, so it should be picto_4.png.

    Also, the whole var declaration doesn't make much sense at all... first you set it to 0, then you set it to indexPath.row, and in the loop it is completely redefined....

提交回复
热议问题