默认情况下,iOS模拟器是否有一个ACAccount存储,它是否可以用于测试ACAccountStore和ACAccount API?
发布于 2015-08-05 07:34:02
我想你想知道是否有人可以在他们的代码中使用ACaccounts,同时在模拟器上测试。是的,我们可以使用ACaccounts。
在模拟器中添加帐户:
你实际上可以去iOS模拟器上的设置应用程序并添加帐户--就像使用真正的手机一样。
例如,,如果有人想使用所有的twitter帐户:
ACAccountStore *accountStore = [[ACAccountStore alloc] init] ;
ACAccountType *twitterAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
NSArray *twitterAccounts = [accountStore accountsWithAccountType:twitterAccountType];
if(twitterAccounts)
{
NSLog(@"twitterAccounts: %@",twitterAccounts);
}发布于 2015-08-05 07:30:29
默认情况下,No.It没有ACAccount存储。
ACAccountStore类提供了一个用于访问、操作和存储帐户的接口。若要从帐户数据库创建和检索帐户,必须创建一个ACAccountStore对象。每个ACAccount对象都属于一个ACAccountStore对象.
有关更多细节,请参阅苹果开发者论坛- https://developer.apple.com/library/prerelease/ios/documentation/Accounts/Reference/ACAccountStoreClassRef/index.html。
https://stackoverflow.com/questions/31825933
复制相似问题