0

我有类 User.swift:

import UIKit
@objc(User)

class User: DBObject {
    dynamic var Sync: NSNumber?
    dynamic var Login: NSString?
    dynamic var Password: NSString?
    dynamic var id_Worker: NSNumber?

static func authorize(login: String, password: String) -> Bool{
    var query = User.query().whereWithFormat("login = %@ and password = %@", withParameters: [login, password.md5])

    var resSet = query.fetch() as DBResultSet

    if resSet.count > 0 {
        var user = resSet[0] as! User
    }

    if resSet.count > 0{
        return true
    } else {
        return false
    }
}

}

我想从 DBResultSet 中检索用户对象。但是在调试器下,我得到了这个奇怪的结构:

在此处输入图像描述

如何从 DBResultSet 中检索对象用户?

4

0 回答 0