デバイスに接続されているすべてのユーザーの Twitter アカウントをUIActionSheet
. たとえば、私のデバイスには 3 つの Twitter アカウントがあります。アクション シートにキャンセル ボタン付きのアカウントを一覧表示してほしい。現在、私の関数は次のようになっています。
- (void)showAlertViewForAccounts:(NSArray*)accounts {
accounts = _.arrayMap(accounts, ^id(ACAccount *account) {
return account.username;
});
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Choose an account:"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:nil];
for (NSString *username in accounts) {
[actionSheet addButtonWithTitle:username];
}
[actionSheet showInView:[[[[[UIApplication sharedApplication] delegate] window] rootViewController] view]];
}
私の問題は、アクション シートの別の「セクション」にキャンセル ボタンが表示されないことです。
accounts
A.)配列を に変換しva_list
てメソッドのパラメーターとして渡すUIActionSheet
init...
か、B.) キャンセル ボタンを別の「セクション」に表示するように指定できますか?