Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 具有手动引用计数的所有权修饰符_Objective C - Fatal编程技术网

Objective c 具有手动引用计数的所有权修饰符

Objective c 具有手动引用计数的所有权修饰符,objective-c,Objective C,当您使用Objective-C onwership修饰符(\uuuuu strong,\uuuuu Slong,\uuuuuu unretained)和手动引用计数时会发生什么情况?它们中是否有任何一个修改了被忽略的对象的行为 clang-E-dM显示内置宏的定义: $ clang -E -dM -x objective-c /dev/null | egrep "weak|strong|unsafe" #define __strong #define __unsafe_unretained

当您使用Objective-C onwership修饰符(
\uuuuu strong,\uuuuu Slong,\uuuuuu unretained
)和手动引用计数时会发生什么情况?它们中是否有任何一个修改了被忽略的对象的行为

clang-E-dM
显示内置宏的定义:

$ clang -E -dM -x objective-c /dev/null | egrep "weak|strong|unsafe" #define __strong #define __unsafe_unretained #define __weak __attribute__((objc_gc(weak))) 为了完整起见:对于ARC,所有权修饰符是内置的 宏定义如下:

$ clang -E -dM -x objective-c -fobjc-arc /dev/null | egrep "weak|strong|unsafe" #define __strong __attribute__((objc_ownership(strong))) #define __unsafe_unretained __attribute__((objc_ownership(none))) #define __weak __attribute__((objc_ownership(weak))) $clang-E-dM-x objective-c-fobjc-arc/dev/null | egrep“弱|强|不安全” #定义_强_属性_((objc_所有权(强))) #定义uuu不安全u未恢复uuuu属性uuuu((objc_所有权(无))) #定义弱属性((对象所有权(弱))) $ clang -E -dM -x objective-c -fobjc-arc /dev/null | egrep "weak|strong|unsafe" #define __strong __attribute__((objc_ownership(strong))) #define __unsafe_unretained __attribute__((objc_ownership(none))) #define __weak __attribute__((objc_ownership(weak)))