2
如何在下面的第3行修復編譯器錯誤'receiver' is unavailable: this system field has retaining ownership
?爲什麼在ARC中objc_super.receiver不可用?
UIKIT_STATIC_INLINE void sample_drawRect(id self, SEL _cmd, CGRect rect) {
struct objc_super super;
super.receiver = self;
super.super_class = class_getSuperclass([self class]);
objc_msgSendSuper(&super, @selector(drawRect:));
}
如果使用malloc和一個指向struct objc_super的指針,會發生什麼? – 2012-02-17 15:42:32