目前我正在使用

...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];

这有可能吗?

谢谢!

最佳答案

如果数组中有对象,可以通过枚举数组来添加otherButtonTitles:

(NSString * title in Strings)

{
[alert addButtonWithTitle:title];
}

关于iphone - 将NSArray作为otherButtonTitles传递-iOS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6151447/

10-10 17:15