You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If value is a null pointer or the object to which it points has begun deallocation, object is zero-initialized. Otherwise, object is registered as a __weak object pointing to value. Equivalent to the following code:
idobjc_initWeak(id *object, id value) {
*addr = 0;
if (!val) returnnil;
returnobjc_storeWeak(object, value);
}
看了你这篇 《weak 弱引用的实现方式》 文章 ,里面提到 :
我想问下 你是怎么知道 调用
objc_initWeak
这个函数的? 我自己尝试着clang
, 转换的代码如下:然后
objc_ownership()
又是啥? 我在runtime
源码里木有搜到...The text was updated successfully, but these errors were encountered: