<tfoot id='GiVNX'></tfoot>

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

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

    1. NSArray vs NSDictionary 查找

      NSArray vs NSDictionary look up(NSArray vs NSDictionary 查找)

          • <bdo id='0LJK7'></bdo><ul id='0LJK7'></ul>
          • <legend id='0LJK7'><style id='0LJK7'><dir id='0LJK7'><q id='0LJK7'></q></dir></style></legend>

              <tbody id='0LJK7'></tbody>

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

              • <small id='0LJK7'></small><noframes id='0LJK7'>

              • 本文介绍了NSArray vs NSDictionary 查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                检查一个对象是否已经存在于一个列表中更快更便宜.通过使用 NSArray contains 对象或检查 NSDictionary 的键是否已存在?

                Which is quicker and less expensive for checking if an object already exists within a list. By using the NSArray contains object or by checking if a key already exists for an NSDictionary?

                NSArray containsObject 选择器是否也遍历整个数组元素?另外检查一个键是否已经存在于字典中呢?这是否需要遍历所有键.

                Also does the NSArray containObject selecter iterate through the whole array elements? Also what about checking if a key already exists within a dictionary? Does that require iterating through all the keys.

                最后,检查一个对象是否已经存在于(同一类的)大对象列表中的最好和最快的方法是什么.

                Finally, what is the best and quickest way to check if an object already exists within a large list of objects (of the same class).

                提前致谢

                推荐答案

                你说的是多少个值?速度上的差异可能无关紧要,因此使选择成为代码中最有意义的选择.事实上,这可能应该是第一要务,除非并且直到您知道存在速度问题.

                How many values are you talking about? The difference in speed may be irrelevant, thus making the choice be the one that makes the most sense in the code. In fact, that should probably be the first priority, unless and until you know that there is a speed problem.

                短版:使用 NSDictionary,除非您有特殊需要.

                Short version: Use NSDictionary unless you have a specific need not to.

                这篇关于NSArray vs NSDictionary 查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                Cocos2d - How to check for Intersection between objects in different layers(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 场景重启?)
                [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)

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

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

                            <tbody id='IwTyH'></tbody>