Answer the question
In order to leave comments, you need to log in
Why are storyboard object ids duplicated in runtime ios?
When developing an application for ios8 in the swift language, a strange bug appeared.
There is a tableView of a dozen elements, each element has a stepper and a label, where the value clicked on the stepper is displayed. Each element should have its own value (what they stumbled upon). If there are few elements (less than 6) everything works fine. But if there are more elements, then by clicking on one stepper, it turns out that another one at the very bottom of the list also increases. When debugging, it turned out that even the id of these objects in memory are the same. How could this happen and what can be done about it?
My guess is that it's because scrolling occurs and elements don't respawn on the screen correctly.
Answer the question
In order to leave comments, you need to log in
The fact is that iOS reuses already created cells, you need to save the value somewhere, and set it when calling the cellforrowatindexpath method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question