エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
記事へのコメント2件
- 注目コメント
- 新着コメント
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Objective-Cでalias_method_chain - Hello, world! - s21g
1 #import <objc/runtime.h> 2 3 id (*foo_without_bar)(id, SEL); 4 id foo_with_bar(id self, SEL ... 1 #import <objc/runtime.h> 2 3 id (*foo_without_bar)(id, SEL); 4 id foo_with_bar(id self, SEL selector) 5 { 6 /* do your work here */ 7 return foo_without_bar(self, selector); 8 } 9 10 // exchange method implementation 11 SEL fooSelector = @selector(foo); 12 Method method = class_getInstanceMethod(class, fooSelector); 13 *(IMP*)&foo_without_bar = 14 method_getImplementation(method); 15
2008/11/07 リンク