<tfoot id='15Vmx'></tfoot>

      <legend id='15Vmx'><style id='15Vmx'><dir id='15Vmx'><q id='15Vmx'></q></dir></style></legend>

      <small id='15Vmx'></small><noframes id='15Vmx'>

      • <bdo id='15Vmx'></bdo><ul id='15Vmx'></ul>

        <i id='15Vmx'><tr id='15Vmx'><dt id='15Vmx'><q id='15Vmx'><span id='15Vmx'><b id='15Vmx'><form id='15Vmx'><ins id='15Vmx'></ins><ul id='15Vmx'></ul><sub id='15Vmx'></sub></form><legend id='15Vmx'></legend><bdo id='15Vmx'><pre id='15Vmx'><center id='15Vmx'></center></pre></bdo></b><th id='15Vmx'></th></span></q></dt></tr></i><div id='15Vmx'><tfoot id='15Vmx'></tfoot><dl id='15Vmx'><fieldset id='15Vmx'></fieldset></dl></div>
      1. NSNotificationCenter 与委派(使用协议)?

        NSNotificationCenter vs delegation( using protocols )?(NSNotificationCenter 与委派(使用协议)?)
        <i id='155Qc'><tr id='155Qc'><dt id='155Qc'><q id='155Qc'><span id='155Qc'><b id='155Qc'><form id='155Qc'><ins id='155Qc'></ins><ul id='155Qc'></ul><sub id='155Qc'></sub></form><legend id='155Qc'></legend><bdo id='155Qc'><pre id='155Qc'><center id='155Qc'></center></pre></bdo></b><th id='155Qc'></th></span></q></dt></tr></i><div id='155Qc'><tfoot id='155Qc'></tfoot><dl id='155Qc'><fieldset id='155Qc'></fieldset></dl></div>

            <bdo id='155Qc'></bdo><ul id='155Qc'></ul>

                <legend id='155Qc'><style id='155Qc'><dir id='155Qc'><q id='155Qc'></q></dir></style></legend>
                <tfoot id='155Qc'></tfoot>

                • <small id='155Qc'></small><noframes id='155Qc'>

                    <tbody id='155Qc'></tbody>

                • 本文介绍了NSNotificationCenter 与委派(使用协议)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  它们各自的优缺点是什么?
                  我应该具体在哪里使用它们?

                  What are the pros and cons of each of them?
                  Where should I use them specifically?

                  推荐答案

                  这里的经验法则是有多少客户希望收到事件通知.如果它主要是一个对象(例如,关闭视图或对单击的按钮进行操作,或对下载失败做出反应),那么您应该使用委托模型.

                  The rule of thumb here is how many clients would like to be notified of an event. If it's mainly one object (e.g. to dismiss a view or to act upon a button clicked, or to react to a failed download) then you should use the delegate model.

                  如果您发出的事件可能同时对许多对象感兴趣(例如屏幕旋转、内存使用、用户登录/注销),那么您应该使用 NSNotificationCenter.

                  If the event you emit may be of an interest to many objects at once (e.g. screen rotated, memory usage, user login/logout), then you should use the NSNotificationCenter.

                  这篇关于NSNotificationCenter 与委派(使用协议)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  How to pass a #39;tap#39; to UIButton that is underneath UIView with UISwipeGestureRecognizer?(如何使用 UISwipeGestureRecognizer 将“点击传递给 UIView 下方的 UIButton?)
                  Objective c - Best practice to handle a button touch event for a button of a custom UITableViewCell(Objective c - 为自定义 UITableViewCell 的按钮处理按钮触摸事件的最佳实践)
                  UIButton targets not working if a UIView is added as a subview(如果将 UIView 添加为子视图,则 UIButton 目标不起作用)
                  Tint UIButton#39;s image from interface builder with UIImageRenderingModeAlwaysTemplate(使用 UIImageRenderingModeAlwaysTemplate 从界面生成器中为 UIButton 的图像着色)
                  How can i increase the button width dynamically depends on the text size in iphone?(如何根据 iphone 中的文本大小动态增加按钮宽度?)
                  What#39;s the difference between UIControlStateHighlighted and UIControlStateSelected?(UIControlStateHighlighted 和 UIControlStateSelected 有什么区别?)
                  <i id='v0Iew'><tr id='v0Iew'><dt id='v0Iew'><q id='v0Iew'><span id='v0Iew'><b id='v0Iew'><form id='v0Iew'><ins id='v0Iew'></ins><ul id='v0Iew'></ul><sub id='v0Iew'></sub></form><legend id='v0Iew'></legend><bdo id='v0Iew'><pre id='v0Iew'><center id='v0Iew'></center></pre></bdo></b><th id='v0Iew'></th></span></q></dt></tr></i><div id='v0Iew'><tfoot id='v0Iew'></tfoot><dl id='v0Iew'><fieldset id='v0Iew'></fieldset></dl></div>

                    <legend id='v0Iew'><style id='v0Iew'><dir id='v0Iew'><q id='v0Iew'></q></dir></style></legend>
                  • <tfoot id='v0Iew'></tfoot>
                  • <small id='v0Iew'></small><noframes id='v0Iew'>

                      • <bdo id='v0Iew'></bdo><ul id='v0Iew'></ul>

                              <tbody id='v0Iew'></tbody>