目前我正在使用
...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/