Apple has deprecated
poseAsClass: method for OS X v10.5 and above. Is there another way to make class posing work?
Alternative to poseAsClass in Mac OS X 10.5 and higher?
I don't think there is a class-level equivalent, but you can exchange the implementation of two methods, which was often the purpose of using
poseAsClass: (of course, you can exchange more than one method if you need to override multiple methods in a class). You want method_exchangeImplementations in the Objective-C 2.0 runtime (
#import objc/runtime.h). A word of warning: after calling method_exchangeImplementations, calling the 'new' method actually calls the original method definition.