我正在使用sqlite文件從authorId中獲取diaryEntriesTeacher。它產生的AuthorID的下列對象時我打印變量的AuthorID是零 代碼: -swift 3.0如何在Swift 3的`Any`中訪問`AnyHashable`類型?
func applySelectQuery() {
checkDataBaseFile()
objFMDB = FMDatabase(path: fullPathOfDB)
objFMDB.open()
objFMDB.beginTransaction()
do {
let results = try objFMDB.executeQuery("select * from diaryEntriesTeacher", values: nil)
while results.next() {
let totalCount = results.resultDictionary
let authorId = totalCount?["authorId"]!
print("authorId",authorId)
}
}
catch {
print(error.localizedDescription)
}
print(fullPathOfDB)
self.objFMDB.commit()
self.objFMDB.close()
}
我想在這裏找到你要找的解決方案: [https://stackoverflow.com/questions/39864381/how-can-i-access-anyhashable-types-in-any-in-迅速](https://stackoverflow.com/questions/39864381/how-can-i-access-anyhashable-types-in-any-in-swift) – Diego