开发者

iphone - initializing a UIActionSheet with an array of buttons

开发者 https://www.devze.com 2023-01-12 06:41 出处:网络
I am initializing a UIActionSheet and I would like to popula开发者_开发知识库te its \"otherButtonTitles\" from an Array, Set, or whatever, like this

I am initializing a UIActionSheet and I would like to popula开发者_开发知识库te 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消