9th Thu
Methodからmethod_impを取得する方法のメモ
Objective-Cで、Method構造体からCレベルの関数ポインタを取得する方法のメモです。
以前は、
objective-c>>
Method *method = class_getInstanceMethod(class, selector);
IMP imp = method->method_imp;
<<--
という感じで取得出来ていたみたいですが、現在はDeprecatedとなっており、
以下のようにする必要があるようです。
objective-c>>
IMP imp = method_getImplementation(method);
<<--
posted by
genki on Thu 9 Oct 2008 at 02:25 with 0 comments