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

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

      1. 自动引用计数问题:将非本地对象的地址传递给

        时间:2023-05-31

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

                <tbody id='pkoNY'></tbody>
            • <small id='pkoNY'></small><noframes id='pkoNY'>

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

              • <bdo id='pkoNY'></bdo><ul id='pkoNY'></ul>
                1. 本文介绍了自动引用计数问题:将非本地对象的地址传递给 __autoreleasing 参数以进行回写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试将指针传递给指向方法的指针,但显然 ARC 对我的操作方式存在一些问题.这里有两种方法:

                  I'm trying to pass pointer to pointer to a method, but apparently ARC has some issues with how I'm doing it. Here the two methods:

                  + (NSString *)personPropertyNameForIndex:(kSHLPersonDetailsTableRowIndex)index 
                  {
                      static NSArray *propertyNames = nil;
                  
                      (nil == propertyNames) ? 
                          [self SHL_initPersonPropertyNamesWithArray:&propertyNames] : NULL;
                  }
                  
                  + (void)SHL_initPersonPropertyNamesWithArray:(NSArray **)theArray
                  {
                      *theArray = [[NSArray alloc] 
                                   initWithObjects:@"name", @"email", @"birthdate", @"phone", nil];
                  }
                  

                  我收到以下错误:

                  自动引用计数问题:将非本地对象的地址传递给 __autoreleasing 参数以进行回写

                  Automatic Reference Counting Issue: Passing address of non-local object to __autoreleasing parameter for write-back

                  在出现以下命令的那一行:

                  On the line which the following command appears:

                  [self SHL_initPersonPropertyNamesWithArray:&propertyNames] : NULL;
                  

                  推荐答案

                  这种情况需要 __strong 存储限定符.

                  The __strong storage qualifier is needed for this case.

                  + (void)SHL_initPersonPropertyNamesWithArray:(NSArray * __strong *)theArray
                  

                  但是,此代码不遵循 基本内存管理规则.

                  However, this code doesn't follow the Basic Memory Management Rules.

                  您拥有您创建的任何对象

                  You own any object you create

                  您使用名称以alloc"、new"、copy"或mutableCopy"开头的方法创建对象(例如,alloc、newObject 或 mutableCopy).

                  You create an object using a method whose name begins with "alloc", "new", "copy", or "mutableCopy" (for example, alloc, newObject, or mutableCopy).

                  你为什么要这样做?

                  这篇关于自动引用计数问题:将非本地对象的地址传递给 __autoreleasing 参数以进行回写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何禁用 UITextview 选择文本,复制/粘贴 UIMenuCo 下一篇:接收没有音频的远程控制事件

                  相关文章

                  最新文章

                2. <legend id='6Zl3t'><style id='6Zl3t'><dir id='6Zl3t'><q id='6Zl3t'></q></dir></style></legend>

                    <small id='6Zl3t'></small><noframes id='6Zl3t'>

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