-[UITableViewCell setSelected:]
デバッグ目的で独自の実装に置き換えることができます。以下、UITableViewCellSetSelected
UIKitのメソッドの代わりに呼び出されます。
static void (*__originalUITableViewCellSetSelected)( UITableViewCell *, SEL, BOOL ) ;
static void UITableViewCellSetSelected( UITableViewCell * self, SEL _cmd, BOOL b )
{
// your code here... (or set a breakpoint here)
NSLog(@"%@<%p> b=%s\n", [ self class ], self, b ? "YES" : "NO" ) ;
(*__originalUITableViewCellSetSelected)( self, _cmd, b ) ; // call original implementation:
}
@implementation UITableViewCell (DebugIt)
+(void)load
{
Method m = class_getInstanceMethod( [ self class ], @selector( setSelected: ) ) ;
__originalUITableViewCellSetSelected = (void(*)(id, SEL, BOOL))method_getImplementation( m ) ;
method_setImplementation( m, (IMP)UITableViewCellSetSelected ) ;
}
@end