Indexpath.row returns a random range number on didSelectRowAtIndexPath?

I have a program, the main view with a subnib. Inside this nib is a perfectly loaded table with data that has been archived.

I released a product that already uses table views, read the manuals, I know how they work (mostly) ... StackOverflow exists for some reason ...

Now I continued to select errors out of range, so I ran this: [NSLog ... indexPath.row)] and noticed that every time I select a new cell, it is almost random. If I select cell 2 in the cell, I get this pattern 0, 2, 0, 2. If I leave alone, it will be one choice. But it is as if their values ​​are slowly changing. There are no data, but cell 3 returns all 5 numbers as a string 0-4 depending on how much my clicks are changing (in the simulator).

I probably have another problem as it accesses the array and crashes when trying to add or remove objects in the index (which used to work fine).

I will reboot the computer and uninstall the simulator application and reinstall (the data will be corrupted quite often using the archived key during development), but I thought I would ask if anyone knew why this would happen.

Asking Apple for help usually results in “Do you know how to program? Read the manual again!” and I'm tired of being treated as if I hadn't been coded for 10 years because they are too lazy to document important things.

Thank! If I missed something and it was asked, write me, please!

NC

+3
source share

Source: https://habr.com/ru/post/1796519/


All Articles