2015-12-17 14 views

回答

1

嘗試用一些錯誤處理。如果有任何錯誤,你會發現。

do { 
    if try db.run(delRowCo.delete()) > 0 { 
     print("deleted") 
    } else { 
     print("row not found") 
    } 
} catch { 
    print("delete failed: \(error)") 
} 
+0

謝謝,現在我可以修復bug @Bhathiya –

0

也試試這個。

let mytable = Table("ContactTable") 
let delRowCo = mytable.filter(ContactID == 'contact_id') 
try db.run(delRowCo.delete())