I got more and more crash-reports from apple (all on iPhone 5, iOS 10.3.3) on the following lines of code:
let date = NSDate()
var dateComponents = DateComponents()
dateComponents.hour = -6
let calculatedDate = NSCalendar.current.date(byAdding: dateComponents, to: date as Date)
let selectStatement = "SELECT nr from info where date > \(UInt((calculatedDate!.timeIntervalSince1970)) * 1000);"
The crash-report states the last line as the problem-line. So it seems, that calculatedDate is not instantiated.
In a former version a crash even occured in the first line (iPhone 5, iOS 10.3.2)
I by myself can't reproduce these crashes on an iPhone 6s.
Any suggestions what could go wrong in these statements?