Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -139,20 +139,23 @@ struct objc_object *obj = (struct objc_object*)obj_; return obj->isa; } -static inline void +static inline Class object_setClass(id obj_, Class cls) { struct objc_object *obj = (struct objc_object*)obj_; + Class old = obj->isa; obj->isa = cls; + + return old; } static inline const char* object_getClassName(id obj) { return class_getName(object_getClass(obj)); } #endif