I'm currently learning how to build apps entirely programatically and have hit a bit of a wall in the process. 

My app is going to be a fairly simple form that the user can fill in and it will generate a PDF at the end containing the information. For the basic information I have a tableview containing a set of UITextfields and have no problem iterating through them and extracting the data into an array of strings. 
For the next section the user needed to input a lot more text so I have used UITextviews within the tableview. What I want to be able to do is extract the text inputted and save it to an array of strings that is used to create my customer object. The code that does this is as follows:

```
func createGoals() {
   for section in 0..<secondTableView.numberOfSections {

        for row in 0..<secondTableView.numberOfRows(inSection: section) {

            let indexPath = NSIndexPath(row: row, section: section)
            let thisCell = secondTableView.cellForRow(at: indexPath as IndexPath) as! mySecondCell
                if thisCell.textview.text == "Enter Goals" {
                print("NO CONTENT IN FIELD")
                let ac = UIAlertController(title: "But...But...", message: "If you have no goals, how can you progress?!", preferredStyle: .alert)
                ac.addAction(UIAlertAction(title: "OK", style: .default))
                present(ac, animated: true)
                break
                }  else {
                    print("I MADE IT")
                    print("\(thisCell.textview.text!)")
                    newClient.goalArray.append(thisCell.textview.text)
                    print(newClient.goalArray)
                    }
        }
    }

}

```

But when this runs I get the error message "unexpectedly found nil while unwrapping an Optional value" and it particularly highlights this line:

```
let thisCell = secondTableView.cellForRow(at: indexPath as IndexPath) as! mySecondCell

```

This code is almost identical to how I iterate through the UITextfields successfully, all thats changed is the variables attached and as far as I can see there are no optionals.
Also if I don't fill in the UITextviews it will show the UIAlertController, it only seems to have a problem when I remove the placeholder and fill in the UITextviews.
Does anyone have any ideas as to why this is happening? I can provide more of my code if needed.