New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS 12 MultipleSelectorRow Crash: Index out of bounds #1575
Comments
I can confirm I am seeing this issue. In the example you show I can see that This looks like an iOS bug. I think you should file a radar if there isn't one already. As this is an edge case and we are still in beta for iOS 12 we will not work on a workaround for now. |
Hello. I am seeing a potentially related issue in earlier iOS versions (managed to reproduce it in iOS 11, but there doesn't seem to be anything special about it, could be reproducible in earlier versions too). How the crash happens for us:
What I think is going on here is a classic race condition - UITableView is still being reloaded (and happily calling IndexPaths up to 4, as it was originally set up), but due to the |
What is weird about the first case is that the cell to be removed has index 2 but the function is called with index 4 while only one row had been removed. Apart from that it seems that iOS definitely takes some time to actually remove a cell and if something happens during that time the indexPaths involved might go out of bounds. I am not sure it is a good idea to change form +++ Section()
form.last! <<< TextRow() // section might not have been added yet |
In my case, it was reloadData(), which is known to take a long time. Given that, I'm not too surprised to hear that removing cells and redrawing also takes an undefined amount of time. That's why
It appears that we have to resort to hacks with scheduling on the next runloop or use updating methods with completion blocks. What would be easier to implement given the current architecture?
Probably it is because the table is just getting around to drawing the last "Add New Tag" row from the original set of cells. This looks very similar to my case - have several cells, start drawing it, quickly remove (hide) one - crash while trying to finish drawing cells which should have been at the end of the original list |
The crash with the MultipleSelectorRow does not happen in the drawing call but in |
It happens in iOS 11.4 too (Simulator). |
It seems to be fixed now. Closed. |
iOS 13 has the same issue not always but it happens |
Xcode 10, iOS 12, MultipleSelectorRow will crash when I delete quickly. (iOS 11 simulator will not)
quick-crash:
slow:
it could be a bug of system, report here for less confusing.
The text was updated successfully, but these errors were encountered: