objective-c 调用任意父类函数,父类的父类函数

struct objc_super sp;
sp.receiver = self;
sp.super_class = [SpriteEmitterCannon_ByAnimation class];
objc_msgSendSuper(&sp, @selector(playSomeAnimation:),nil);

receiver是当前对象的指针,super_class是要调用的父类的名称。

原文地址:http://www.lanxingxing.net/?p=131

猜你喜欢

转载自blog.csdn.net/no_this/article/details/7694389