We were developing an app and ran into a small problem.
We
have a tableview inside another tableview (Pulse-like UI) and
have implemented the didSelectRowAtIndexPath callback in our app to detect selections. Until iOS 6,
it worked just fine. But after upgrading our test device to iOS 7, we
realised that we are getting wrong values for indexPath.row on click of a
cell. What could be the problem?
Here’s a little information we found when we tried to debug:
– We logged the value of indexPath.row on clicking and found that the value was actually corresponding to the cell that was in the same place as the cell we clicked before scrolling.
– For instance, we have 6 items in our inner tableview, showing 3 at a
time. The indices of the items are 0, 1, 2 … 5. Initially, we will be able to see 0, 1
and 2. Upon scrolling to the very end, we will be seeing 3, 4 and 5.
But when we click on 5, we sometimes get indexPath.row is 2. Similarly
on scrolling backwards from this state, when we click on item 0, we get
indexPath.row is 3.
We realised that our environment is not updated (OSX 10.8.2, RubyMotion 2.6, Xcode 4.6). Could this be the problem? Do you think upgrading to OSX 10.9 and Xcode 5 will fix the issue?
Thank you.