MacOSXプログラミング。毎日更新。 話題: Cocoa, Objective-C, Snow Leopard (前回)Cocoaの日々: Objective-C 2.0 ランタイムの情報 2.0 ランタイムから追加された method_exchangeImplementations を使ってメソッドを置換してみる。 具体的な方法は下記のサイトが参考になった。 MethodReplacement CocoaDev: MethodSwizzling Mac Dev Center のコードがシンプルでとてもわかりやすい。 が、ここでは Cocoa Dev のたくさん方法が書いてある中で下記のコードを使ってみた。 void Swizzle(Class c, SEL orig, SEL new) { Method origMethod = class_getInstanceMethod(c, o