iphone - 将 NSArray 作为 otherButtonTitles 传递 - iOS

标签 iphone ios ipad

目前我正在使用

...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/

相关文章:

iphone - 如何更改标签栏 Controller 项目名称的字体大小?

ios - ScrollView 中的 TableView

ios - Parse.com - 来自 PFUser 对象的电子邮件尽管有值(value),但获取为零

iphone - 从具有 BOOL 值的 plist 问题中读取 NSDictionary

ios - 按照 Apple 建议检查 iOS 版本

ios - 属性 "com.apple.security.application-groups in"在设备中不起作用

iphone - 核心数据实体属性的初始值?

ios - 如何以编程方式在 iPhone 中强制选择 2G 或 3G?

ios - Apple Push Notifications - 将数据放入应用程序

ios - UIWebView HTML 显示为文本