首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从ACAccountstore获取Twitter用户名-

从ACAccountstore获取Twitter用户名-
EN

Stack Overflow用户
提问于 2013-10-30 16:48:00
回答 1查看 726关注 0票数 0

我把ACAccount存储在一个数组中-

代码语言:javascript
复制
 NSArray *arrayOfAccounts = [accountStore accountsWithAccountType:accountType];

通过打印arrayOfAccounts -

代码语言:javascript
复制
  (
  "type:com.apple.twitter\nidentifier: 9E8DD039-D210-49EB-90D3-797017EC9F37\naccountDescription: @kaleshnewage\nusername: kaleshnewage\nobjectID: x-coredata://8CD38D83-7C1C-4542-BE4B-7007B6586675/Account/p24\nenabledDataclasses: {(\n)}\nenableAndSyncableDataclasses: {(\n)}\nproperties: {\n    \"user_id\" = 1407688573;\n}\nparentAccount: (null)\nowningBundleID:(null)",
"type:com.apple.twitter\nidentifier: 888F056F-8BB2-4847-91D3-CFFE93770F01\naccountDescription: @dasarun5\nusername: dasarun5\nobjectID: x-coredata://8CD38D83-7C1C-4542-BE4B-7007B6586675/Account/p25\nenabledDataclasses: {(\n)}\nenableAndSyncableDataclasses: {(\n)}\nproperties: {\n    \"user_id\" = 120014192;\n}\nparentAccount: (null)\nowningBundleID:(null)",
"type:com.apple.twitter\nidentifier: 3BB57617-0436-4801-B302-CE7C67D2E2A5\naccountDescription: @arunjoseph700\nusername: arunjoseph700\nobjectID: x-coredata://8CD38D83-7C1C-4542-BE4B-7007B6586675/Account/p28\nenabledDataclasses: {(\n)}\nenableAndSyncableDataclasses: {(\n)}\nproperties: {\n    \"user_id\" = 1068508537;\n}\nparentAccount: (null)\nowningBundleID:(null)"
)

现在我只想把用户名放到另一个数组中,怎么做呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-30 17:14:04

accountsWithAccountType:返回一个ACAccount数组,因此您可以这样做:

代码语言:javascript
复制
for (ACAccount *account in arrayOfAccounts) {
    NSLog(@"Username: %@", account.username);
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19688951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档