【发布时间】:2011-05-17 05:15:35
【问题描述】:
在我的一个 iPhone 应用程序中,我需要有条件地将变量参数发送到操作表。即
if(condition1)
otherButtonTitles = @"Button1", @"Button2", nil
else
otherButtonTitles = @"Button3", @"Button4", nil
UIActionSheet *mediaActionsSheet = [[UIActionSheet alloc] initWithTitle: nil
delegate: self
cancelButtonTitle: @"Cancel"
destructiveButtonTitle: nil
otherButtonTitles: otherButtonTitles];
执行此操作的语法是什么? otherButtonTitles 的数据类型应该如何定义?
【问题讨论】:
标签: objective-c iphone macos conditional-statements variadic-functions