iOS 模拟器是否默认有一个 ACAccount 存储,是否可以操纵它来测试 ACAccountStore 和 ACAccount API?
最佳答案
我想你想知道是否有人可以在他们的代码中使用 ACaccounts,同时在模拟器上进行测试。 是的,我们可以使用 ACaccounts。
在模拟器中添加帐户:
您实际上可以转到 iOS 模拟器上的“设置”应用并添加帐户 - 就像使用真正的手机一样。
例如,如果有人想使用所有 Twitter 帐户:
ACAccountStore *accountStore = [[ACAccountStore alloc] init] ;
ACAccountType *twitterAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
NSArray *twitterAccounts = [accountStore accountsWithAccountType:twitterAccountType];
if(twitterAccounts)
{
NSLog(@"twitterAccounts: %@",twitterAccounts);
}
关于ios - iOS 模拟器默认有一个 ACAccount 存储吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31825933/