3

我通过 Locksmith Keychain 保存了我的帐户,一切正常,现在我需要解析存储到 textField 的数据,请问我该怎么做?这是我用来保存帐户的代码:

let accountsave = Locksmith.saveData(["account": self.txtAccount.text], forUserAccount: "myUserAccount", inService: "myAccount").

现在我需要快速将数据存储解析为文本字段。请帮忙

4

1 回答 1

0

根据我对您的问题的了解,您要求类似以下内容:

let (dictionary, error) = Locksmith.loadDataForUserAccount("myUserAccount", inService: "myAccount")
if let userData = dictionary as? [String:String] {
    if let account = userData["account"] {
        self.txtAccount.text = account
    }
}
于 2015-05-01T14:23:21.750 回答