
1 Livid MOD OP PRO 我目前在用的一种方式是,为这些不同的 UIActionSheet 分配不同的 tag,然后在 delegate 的响应方法里做判断。 所以我好奇是否还有其他更好的方法? |
2 ydhydh 2012 年 2 月 27 日 根据 buttonTitle ?? buttonTitleAtIndex |
3 Fann 2012 年 2 月 27 日 同样用 tag 来区分处理,不同的 UIAlertView 也是用 tag 区分。 |
4 fly2never 2012 年 2 月 27 日 目前也是tag区分,还发现什么不好 |
5 Livid MOD OP PRO 那么,如果就是用 tag 来区分的话,在 tag 的编码上,大家是否有什么好的规则心得可以分享一下呢? |
7 froo 2012 年 2 月 27 日 UIActionSheet *sheet1; UIActionSheet *sheet2; 然后在Delegate中用if来判断 if (actiOnsheet== sheet1 ){}, if (actiOnsheet== sheet2 ){} …… 这样可读性应该好一些。 |
9 doskoi 2012 年 2 月 27 日 TAG可以定义成enum enum { kAlertView, kInfomationView, kWarningView, kErrorView } 然后tag = Alertview.tag; switch tag, case不同tag做处理 |
10 levey 2012 年 2 月 27 日 要么用类的变量,要么用tag,我喜欢后者。as.tag = 0x2001 |
12 linlinqi 2012 年 2 月 27 日 我试过用actionSheet的title来判断当它们的标题不一样的时候 |
13 sawyerzhang 2012 年 2 月 27 日 同意 @froo, 直接在IB里面拉很方便的。 |
15 lldong 2012 年 2 月 27 日 支持用tag,而且tag是NSInteger类型,能保证存得下一个指针,有时可以利用这点保存一些和该view关联的信息。 |
16 avatasia 2012 年 2 月 28 日 public class UIActionSheet { public static UIActionShee Sheet1 = new UIActionSheet ("Sheet1"); public static UIActionSheet Sheet2 = new UIActionSheet ("Sheet2"); private UIActionSheet (string type) { } } UIController(UIActionSheet sheet) { } 随便写的 |
17 elden 2012 年 2 月 28 日 Blocks |
18 lex 2012 年 2 月 28 日 |