Using nested if statements to select textfield for update of associated label
First thing:


When you have a structure like that:

if (responses[1] != badResult) {
...
   if (responses[2] != badResult) {
   ...
      if (responses[3] != badResult) {
      ...


You probably have to use a loop, as the number of if statement will increase in function of the number of results in your array.

Also, you try to access to an array value without checking if this index is inside the size of your array:

i.e. : if (index >= 0 AND index &lt; responses.cout )

What if your array has less than 4 values?

So to prevent this, it will look like that:

for (int i = 0; i &lt; responses.count; i++) {
    if (responses[i] != badResult) {
        double num = ([responses[i] floatValue] / 1000.0);
        NSString *currentAnswer = [NSString stringWithFormat:@"%.2f km", num];
        // Do something with 'currentAnswer' like putting it inside an array (datasource)
    }
}



Second Thing


When you have that kind of UI (repetitive stuff, block/pattern of component with common function) 

=> it's always depending on context, 

But, it's better to use a component with reusable view, datasource: UITableView, UICollectionView etc...

You can check this tutorial if you need help to build a table view.

/------------------------------------/ 
          For testing only
/------------------------------------/

Also, there is another way, which is quick and dirty, but it works:

You can use view tag to access them in an ordinate way.


From your storyboard, set the tag value of the first distance label (distanceA) to 100
for distanceB 101
for distanceC 102


and so on...

Now you can access to the label from an integer thanks to 

UILabel *label = (UILabel*)[self.view viewWithTag:100];


So if you put it in the previous loop:

 for (int i = 0; i &lt; responses.count; i++) {
    if (responses[i] != badResult) {
        double num = ([responses[i] floatValue] / 1000.0);
        NSString *currentAnswer = [NSString stringWithFormat:@"%.2f km", num];
        // Getting the label with tag, THIS IS WEAK CODE
        UILabel *label = (UILabel*)[self.view viewWithTag:100+i];
        // set the currentAnswer string
        label.text = currentAnswer;
    }
}


/-------------------------------------------------/

Remember, using UITableView or UICollectionView is much better!