diff --git a/ResearchKit/Common/ORKFormStepViewController.m b/ResearchKit/Common/ORKFormStepViewController.m index 8a2075dff..fe80fc7b1 100644 --- a/ResearchKit/Common/ORKFormStepViewController.m +++ b/ResearchKit/Common/ORKFormStepViewController.m @@ -908,8 +908,8 @@ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPa cell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; } if ([cell isKindOfClass:[ORKChoiceViewCell class]]) { - ORKTableCellItem *cellItem = ([_sections[indexPath.section] items][indexPath.row - 1]); - height = [ORKChoiceViewCell suggestedCellHeightForShortText:cellItem.choice.text longText:cellItem.choice.detailText inTableView:_tableView]; + ORKTableCellItem *cellItem = _sections[indexPath.section].items[indexPath.row - 1]; + height = [ORKChoiceViewCell suggestedCellHeightForShortText:cellItem.choice.text longText:cellItem.choice.detailText inTableView:_tableView]; } } return height; @@ -1014,7 +1014,7 @@ - (void)decodeRestorableStateWithCoder:(NSCoder *)coder { - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - for (ORKFormItemCell *cell in _formItemCells) { + for (ORKFormItemCell *cell in _formItemCells.allValues) { [cell setExpectedLayoutWidth:size.width]; } }