我有这个代码:
UIActionSheet *actionSheet = [[[UIActionSheet alloc]
initWithTitle:@"Illustrations"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles: @"ABC", @"XYZ",
nil] autorelease];
UIImage *image = // whatever, snip
if (image != nil)
{
[actionSheet addButtonWithTitle:@"LMNOP"];
}
它在有条件地添加我的 LMNOP 按钮方面做得很好。
...在取消按钮之后。
如何使用条件按钮构建我的操作表?可悲的是,我不能这样做:
UIActionSheet *actionSheet = [[[UIActionSheet alloc]
// ... etc.
otherButtonTitles: someMutableArray
// ... etc.
因为那肯定会有所帮助。
有任何想法吗?
谢谢!