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

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

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

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

    1. <legend id='RW8Xj'><style id='RW8Xj'><dir id='RW8Xj'><q id='RW8Xj'></q></dir></style></legend>

      1. 如何在 iOS 中找到任何对象的大小?

        How to find the size of any object in iOS?(如何在 iOS 中找到任何对象的大小?)

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

          <tbody id='Z20Fr'></tbody>

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

                <legend id='Z20Fr'><style id='Z20Fr'><dir id='Z20Fr'><q id='Z20Fr'></q></dir></style></legend><tfoot id='Z20Fr'></tfoot>
                  <bdo id='Z20Fr'></bdo><ul id='Z20Fr'></ul>

                  本文介绍了如何在 iOS 中找到任何对象的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在优化我的应用程序,想知道对象的大小是多少,以便我也可以在日志中显示它.

                  I was optimizing my app and wanted to know that how much is the size of the object, so that I can also show it in log.

                  假设我有

                  NSDictionary *temp=(NSDictionary*)[Data objectAtIndex:i];
                  
                  //data is defined in the .h file 
                  

                  现在我怎么知道对象 temp 的大小是多少?

                  now how will I know that how much is the size of the object temp?

                  我尝试使用变量视图并在我发现的临时部分中:

                  I tried using the variable view and in the temp section I found:

                  instance_size=(long int)30498656

                  instance_size 是我的临时对象的确切大小吗?

                  Is the instance_size the exact size of my temp object?.

                  我也试过

                  sizeof(temp);
                  

                  但它在那一点上崩溃了.有什么帮助...?

                  but it crashed on that point. Any help...?

                  推荐答案

                  编译器只知道指针,所以它总是返回指针的大小.要查找分配对象的大小,请尝试类似

                  The compiler knows only about the pointer, and that is why it will always return size of the pointer. To find the size of the allocated object try something like

                  NSLog(@"size of Object: %zd", malloc_size(myObject));
                  

                  这篇关于如何在 iOS 中找到任何对象的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 图形)
                  How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                    <tbody id='MWprT'></tbody>
                    <legend id='MWprT'><style id='MWprT'><dir id='MWprT'><q id='MWprT'></q></dir></style></legend>

                        • <bdo id='MWprT'></bdo><ul id='MWprT'></ul>
                        • <tfoot id='MWprT'></tfoot>

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