在 XCode 中添加断点向我展示了 Swift 1.2 ACAccount 对象有一个_properties对象,该对象又包含@user_id: 0123456789的键/值对。我需要访问这个数值。我已经阅读了文档、谷歌搜索、SO'ed 并盲目地尝试了以下所有方法,但均无济于事:
let accountStore = ACAccountStore()
let accountType = accountStore.accountTypeWithAccountTypeIdentifier( ACAccountTypeIdentifierTwitter )
let allACAccounts = accountStore.accountsWithAccountType( accountType )
let someACAccount = allACAccounts[ 0 ]
someACAccount.valueForKey( "properties" )
someACAccount.mutableArrayValueForKey( "properties" )
someACAccount.valueForKeyPath( "properties" )
someACAccount.valueForUndefinedKey("properties")
someACAccount.valueForKey( "user_id" )
someACAccount.mutableArrayValueForKey( "user_id" )
someACAccount.valueForKeyPath( "user_id" )
someACAccount.valueForUndefinedKey("user_id")
someACAccount.properties
someACAccount._properties
someACAccount.user_id
someACAccount.valueForKey( "properties" ) - 拼写为 "properties" 和 "_properties" - 产生 Builtin.RawPointer 的结果。我不知道这是否有用。