0

Every time I try to connect to my app with a database this error pops up

while { (rsMain!.next()) {
        let productName = rsMain?.string(forColumn: "name")
        let keywords = rsMain?.string(forColumn: "keywordtext")
        let multiField = MultiField(aField1: productName! as NSString, aField2: keywords! as NSString)
        self.dataArray.append(multiField)
        }
    }
  • Which line causes the error? And do note that the `!` operator means "crash here if nil`. Do some debugging and track down the nil values. – rmaddy Mar 24 '17 at 21:14
  • Also, look in the debugger console for the error message. [Edit] your question with the additional details. – rmaddy Mar 24 '17 at 21:15
  • Please read http://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found-nil-while-unwrapping-an-optional-valu thoroughly before writing any more Swift code. – rmaddy Mar 24 '17 at 21:16

0 Answers0