I have a standard picker (copied out of the docs) with 6 rows. The row count is correctly logged as 6. When I try to select the last row:
[delpicker selectRow:5 inComponent:0 animated:NO];
it selects the 4th row instead.
But when I try to:
[delpicker selectRow:4 inComponent:0 animated:NO];
it selects the correct, 4th, row (0 indexed). As a matter of fact, it works fine for rows 0, 1, 2, 3, 4...just not for row 5. Of course if I ask for row 6 it sets it to the first (0th) row.
Really, I want the picker start with showing the row that the user selected before, and I found that that works fine for everything unless the user selected the last row. While trying to figure out why, I learned that even just specifying a specific row, as I did above, is not working. When the user selects the last row, the row is correctly noted to be the last row (row 5). The problem is simply in setting the selectRow.
Any ideas? Thanks!