目前我正在使用
...otherButtonTitles:@"Hotel Laguna", @"Hotel Village", @"Hotel Torre", @"Hotel Baia", nil];
创建UIActionSheet
。
我想传递NSArray ......类似于:
NSArray *names = [[NSArray alloc]
initWithObjects:@"Hotel Laguna", @"Hotel Village", @"Hotel Torre", @"Hotel Baia", nil];
...otherButtonTitles:names];
这有可能吗?
谢谢!
答案 0 :(得分:5)
如果您在数组中有对象,则可以通过枚举数组来添加otherButtonTitles
:
(NSString * title in Strings)
{
[alert addButtonWithTitle:title];
}