In one of my iPhone application, I need to send the variable arguments to the action sheet conditionally. i.e
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];
What is the syntax to do this? How should the data type for otherButtonTitles be defined?
You can’t. (Well, it’s not impossible, but you don’t want to do that.)
Just use
If you really want to construct a variable to hold variable number of arguments, start from this Wikipedia article. But you don’t really want to do that. I promise.