invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug
I get this warning when I tap either of the switches shown below. I've tried capturing the switch state in a var and using that to trigger the do/catch statement but no joy. I've even tried pulling the do/catch into separate functions and I still get the warning. Has anybody else run into this and how did you fix it?
@IBAction func greetingFormat_Tapped(_ sender: UISwitch)
{
let theQuery = theTable_Settings.filter(settingID == 1)
if sender.isOn
{
do {
if try Database.shared.databaseConnection!.run(theQuery.update(greeting_Format <- "true")) > 0
{
greetingFormatLabel_Outlet.text = NSLocalizedString("HelloMrSmith_String", comment: "")
} else {
print("greeting format true not found")
}
} catch {
print("greeting format true update failed! Error: \(error)")
}
} else {
do {
if try Database.shared.databaseConnection!.run(theQuery.update(greeting_Format <- "false")) > 0
{
greetingFormatLabel_Outlet.text = NSLocalizedString("HiJoe_String", comment: "")
} else {
print("greeting format false not found")
}
} catch {
print("greeting format false update failed! Error: \(error)")
}
}
}
@IBAction func nonrefundableSwitch_Tapped(_ sender: UISwitch)
{
let theQuery = theTable_Settings.filter(settingID == 1)
var itsOn: String = ""
if sender.isOn
{
itsOn = "true"
} else {
itsOn = "false"
}
if itsOn == "true"
{
do {
if try Database.shared.databaseConnection!.run(theQuery.update(nonRefundable_Bool <- "true")) > 0
{
depositDueLabel_Outlet.text = NSLocalizedString("nonRefunddepositisdue_String", comment: "")
} else {
print("nonRefundable true not found")
}
} catch {
print("nonRefundable true update failed! Error: \(error)")
}
} else {
do {
if try Database.shared.databaseConnection!.run(theQuery.update(nonRefundable_Bool <- "false")) > 0
{
depositDueLabel_Outlet.text = NSLocalizedString("depositisdue_String", comment: "")
} else {
print("nonRefundable false not found")
}
} catch {
print("nonRefundable false update failed! Error: \(error)")
}
}
}