<bdo id='FCxM2'></bdo><ul id='FCxM2'></ul>
    1. <legend id='FCxM2'><style id='FCxM2'><dir id='FCxM2'><q id='FCxM2'></q></dir></style></legend>
      <tfoot id='FCxM2'></tfoot>

        <i id='FCxM2'><tr id='FCxM2'><dt id='FCxM2'><q id='FCxM2'><span id='FCxM2'><b id='FCxM2'><form id='FCxM2'><ins id='FCxM2'></ins><ul id='FCxM2'></ul><sub id='FCxM2'></sub></form><legend id='FCxM2'></legend><bdo id='FCxM2'><pre id='FCxM2'><center id='FCxM2'></center></pre></bdo></b><th id='FCxM2'></th></span></q></dt></tr></i><div id='FCxM2'><tfoot id='FCxM2'></tfoot><dl id='FCxM2'><fieldset id='FCxM2'></fieldset></dl></div>
      1. <small id='FCxM2'></small><noframes id='FCxM2'>

      2. 代表的几个 UIAlertViews

        Several UIAlertViews for a delegate(代表的几个 UIAlertViews)
        <tfoot id='RNwDy'></tfoot>
              <bdo id='RNwDy'></bdo><ul id='RNwDy'></ul>
            • <legend id='RNwDy'><style id='RNwDy'><dir id='RNwDy'><q id='RNwDy'></q></dir></style></legend>

                <small id='RNwDy'></small><noframes id='RNwDy'>

                1. <i id='RNwDy'><tr id='RNwDy'><dt id='RNwDy'><q id='RNwDy'><span id='RNwDy'><b id='RNwDy'><form id='RNwDy'><ins id='RNwDy'></ins><ul id='RNwDy'></ul><sub id='RNwDy'></sub></form><legend id='RNwDy'></legend><bdo id='RNwDy'><pre id='RNwDy'><center id='RNwDy'></center></pre></bdo></b><th id='RNwDy'></th></span></q></dt></tr></i><div id='RNwDy'><tfoot id='RNwDy'></tfoot><dl id='RNwDy'><fieldset id='RNwDy'></fieldset></dl></div>
                    <tbody id='RNwDy'></tbody>
                2. 本文介绍了代表的几个 UIAlertViews的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  目前我有一个类在此处和那里弹出 UIAlertView.目前,同一个类是这些的代表(这将是非常合乎逻辑的).不幸的是,这些 UIAlertView 将调用该类的相同委托方法.现在,问题是 - 你怎么知道委托方法是从哪个警报视图调用的?我想只检查警报视图的标题,但这并不优雅.处理多个 UIAlertView 最优雅的方法是什么?

                  Currently I've got a class popping up UIAlertViews here and there. Currently, the same class is the delegate for these (it's very logical that it would be). Unfortunately, these UIAlertViews will call the same delegate methods of the class. Now, the question is - how do you know from which alert view a delegate method is invoked? I was thinking of just checking the title of the alert view, but that isn't so elegant. What's the most elegant way to handle several UIAlertViews?

                  推荐答案

                  像这样标记 UIAlertView:

                  #define kAlertViewOne 1
                  #define kAlertViewTwo 2
                  
                  UIAlertView *alertView1 = [[UIAlertView alloc] init...
                  alertView1.tag = kAlertViewOne;
                  
                  UIAlertView *alertView2 = [[UIAlertView alloc] init...
                  alertView2.tag = kAlertViewTwo;
                  

                  然后使用这些标签在委托方法中区分它们:

                  and then differentiate between them in the delegate methods using these tags:

                  - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
                      if(alertView.tag == kAlertViewOne) {
                          // ...
                      } else if(alertView.tag == kAlertViewTwo) {
                          // ...
                      }
                  }
                  

                  这篇关于代表的几个 UIAlertViews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                3. <small id='R96F2'></small><noframes id='R96F2'>

                  <legend id='R96F2'><style id='R96F2'><dir id='R96F2'><q id='R96F2'></q></dir></style></legend>

                      <bdo id='R96F2'></bdo><ul id='R96F2'></ul>

                          <tbody id='R96F2'></tbody>

                      • <tfoot id='R96F2'></tfoot>

                          • <i id='R96F2'><tr id='R96F2'><dt id='R96F2'><q id='R96F2'><span id='R96F2'><b id='R96F2'><form id='R96F2'><ins id='R96F2'></ins><ul id='R96F2'></ul><sub id='R96F2'></sub></form><legend id='R96F2'></legend><bdo id='R96F2'><pre id='R96F2'><center id='R96F2'></center></pre></bdo></b><th id='R96F2'></th></span></q></dt></tr></i><div id='R96F2'><tfoot id='R96F2'></tfoot><dl id='R96F2'><fieldset id='R96F2'></fieldset></dl></div>