我正在使用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