我在Simple Login iOS快速启动指南中遇到了以下问题:由于一个设备可能绑定多个Twitter账户,您需要提供一个代码块来确定要登录哪个账户。请在下方用您自己的代码替换"[yourApp selectUserName:usernames]"以从用户名列表中进行选择。所提供的代码如下:
[authClient loginToTwitterAppWithId:@"YOUR_CONSUMER_KEY"
multipleAccountsHandler:^int(NSArray *usernames) {
// If you do not wish to authenticate with any of these usernames, return NSNotFound.
return [yourApp selectUserName:usernames];
} withCompletionBlock:^(NSError *error, FAUser *user) {
if (error != nil) {
// There was an error authenticating
} else {
// We have an authenticated Twitter user
}
}];
是否最好使用UIActionSheet来让用户选择要使用哪个帐户?该如何实现?