Tag: uialertsheet

使用NSArray来指定otherButtonTitles?

UIAlertSheet的构造函数将一个otherButtonTitles参数作为一个varg列表。 我想从NSArray中指定其他button标题。 这可能吗? 即我必须这样做: id alert = [[UIActionSheet alloc] initWithTitle: titleString delegate: self cancelButtonTitle: cancelString destructiveButtonTitle: nil otherButtonTitles: button1Title, button2Title, nil]; 但是由于我在运行时生成可用button的列表,我真的想要这样的东西: id alert = [[UIActionSheet alloc] initWithTitle: titleString delegate: self cancelButtonTitle: cancelString destructiveButtonTitle: nil otherButtonTitles: otherButtonTitles]; 现在,我想我需要一个单独的调用initWithTitle: 1项目,2项目和3项目。 喜欢这个: if ( [titles count] == 1 ) { alert = [[UIActionSheet alloc] initWithTitle: titleString delegate: […]