<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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Push Notifications are delivered but didReceiveRemoteNotification is never called Swift(推送通知已交付,但 didReceiveRemoteNotification 从未被称为 Swift)
                  didReceiveRemoteNotification function doesn#39;t called with FCM notification server(不使用 FCM 通知服务器调用 didReceiveRemoteNotification 函数)
                  Firebase Cloud Messaging Cannot parse topic name(Firebase 云消息传递无法解析主题名称)
                  Creating Firebase topic for each user(为每个用户创建 Firebase 主题)
                  FCM Notification in iOS doesn#39;t play sound when received(iOS 中的 FCM 通知在收到时不播放声音)
                  Firebase API is not sending push notifications when using the API(使用 API 时 Firebase API 不发送推送通知)
                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>