I have a WKInterfaceTable
with a single row controller. I am using the following code to bind data to the table:
[self.table setNumberOfRows:[data count] withRowType:@"RowController"];
for (int i = 0; i < [data count]; i++)
{
RowController *row = [self.table rowControllerAtIndex:i];
[row bind:[data objectAtIndex:i]]; // sets labels in the row etc.
}
I have the same problem if I add rows one-by-one using insertRowsAtIndexes:withRowTypes:
. In either case, you have to first add a row to the table before you can update the row to show the correct data.
The first issue is that, because of this, the user gets to see the dummy storyboard data in between the row being added and the data being bound to it.
I've tried
- hiding the group containing the table until the loop is finished, but then the first table item on first load ends up as if it were bound entirely to
nil
(even though it isn't) (someone else has seen this) - hiding the group containing each row's content until the group is finished, but the scroll handles this poorly and the rows pop in poorly
- pushing the table out of view with another group until the loop is finished, but you can still scroll down to it
Is there really no way to render a table row before displaying it to the user?