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