2

I am initializing a UIActionSheet and I would like to populate its "otherButtonTitles" from an Array, Set, or whatever, like this

UIActionSheet* aSheet = [[UIActionSheet alloc] initWithTitle:"hi There" 
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:[mySetOfStringsOrWhatever allObjects], nil];

is that possible?

(I have tried this but Xcode doesn't like it)

thanks in advance.

Duck
  • 32,792
  • 46
  • 221
  • 426
  • what does xcode say about it? – Jesse Naugher Aug 16 '10 at 17:48
  • it complains it is expecting a NSString, not an array or set. – Duck Aug 16 '10 at 23:27
  • possible duplicate of [Create UIActionSheet 'otherButtons' by passing in array, not varlist](http://stackoverflow.com/questions/2384044/create-uiactionsheet-otherbuttons-by-passing-in-array-not-varlist) – Caleb Jan 30 '12 at 05:19

1 Answers1

3

I don't believe so, but you can pass nil then iterate through your array/set/whatever and call addButtonWithTitle

See Create UIActionSheet otherButtons by passing in array not varlist

Community
  • 1
  • 1
Eric
  • 3,795
  • 4
  • 28
  • 44