Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Objective-C Runtime Swizzle
Search
Wei Wang
November 20, 2014
Programming
0
160
Objective-C Runtime Swizzle
Wei Wang
November 20, 2014
Tweet
Share
More Decks by Wei Wang
See All by Wei Wang
網路之難,難於上青天 - iPlayground 2019
onevcat
11
4.5k
GMTC 2019 - 在分歧中发展,2019 我们能用 Swift 做什么
onevcat
0
750
从 Swift 到机器学习
onevcat
2
820
iOS Dev - The Dark Side
onevcat
0
110
面向协议编程与 Cocoa 的邂逅
onevcat
14
4.5k
Swift 3 - From Expert to Beginner
onevcat
2
200
如何打造一个让人愉快的框架
onevcat
4
21k
JSPatch Introduction
onevcat
0
180
Unity Memory
onevcat
0
110
Other Decks in Programming
See All in Programming
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
110
Let's learn code review
riofujimon
2
430
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
Goのmultiple errorsについて (2024年4月版)
syumai
4
940
『Railsオワコン』と言われる時代に、なぜブルーモ証券はRailsを選ぶのか
free_world21
0
250
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
380
Elm 0.19.0 Changes
bkuhlmann
0
490
Code Reviews
bkuhlmann
4
890
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
340
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
A better future with KSS
kneath
231
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
243
12k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
Being A Developer After 40
akosma
57
580k
YesSQL, Process and Tooling at Scale
rocio
164
13k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
How to name files
jennybc
65
93k
Debugging Ruby Performance
tmm1
70
11k
Visualization
eitanlees
136
14k
A designer walks into a library…
pauljervisheath
200
23k
Transcript
0CKFDUJWF$3VOUJNF 4XJ[[MF࣮ફ Ԧቨ
ࣗݾհ w ઌ݄ೖ͔ࣾΓɺલຊདྷͨ w J04։ൃ͙Β͍ɻલ৬6OJUZ% w ࠓ-JOF"ET4%,ͷࣄΛ୲͍ͯ͠Δ w ࠷ۙ"OESPJEษڧத w
IUUQHJUIVCDPNPOFWDBU
Ͳ͏ͯ͠0CKFDUJWF$͕ੜ͖Δ ͔Βɺࠓ·Ͱࡀա͗ɻݴޠʹͷ͓دΓ
None
4NBMM5BML ϝοηʔδૹ৴ 4XJ[[MJOH ϝλݴޠ $ͱ$ ޓ "3$ "TTPDJBUFE 0CKFDU --7.$MBOH
($% ັྗతͳ ॊೈੑ
4XJ[[MJOH
.FUIPE$BMMJOH ClassName *object = [[ClassName alloc] init]; [object doItWithA:a]; objc_msgSend(object,
@selector(doItWithA:), a); %JTQBUDI5BCMF .FUIPE *.1 @selector(doIt) doIt @selector(doItWithA:) doItWithA: - (void)doIt { //... } - (void)doItWithA:(id)a { //... }
.FUIPE4XJ[[MJOH %JTQBUDI5BCMF .FUIPE *.1 @selector(doIt) doIt @selector(doItWithA:) doItWithA: @selector(alt_doItWithA:) alt_doItWithA:
- (void)doIt { //... } - (void)doItWithA:(id)a { //... } - (void)alt_doItWithA:(id)a { //... } EP*U8JUI"ͱBMU@EP*U8JUI"Λ4XJ[[MF͠·͢
.FUIPE4XJ[[MJOH %JTQBUDI5BCMF .FUIPE *.1 @selector(doIt) doIt @selector(doItWithA:) doItWithA: @selector(alt_doItWithA:) alt_doItWithA:
- (void)doIt { //... } - (void)doItWithA:(id)a { //... } - (void)alt_doItWithA:(id)a { //... } EP*U8JUI"ͱBMU@EP*U8JUI"Λ4XJ[[MF͠·͢
.FUIPE4XJ[[MJOH %JTQBUDI5BCMF .FUIPE *.1 @selector(doIt) doIt @selector(doItWithA:) doItWithA: @selector(alt_doItWithA:) alt_doItWithA:
- (void)doIt { //... } - (void)doItWithA:(id)a { //... } - (void)alt_doItWithA:(id)a { //... } *.1Λަ͠·͢
%FNP -JOF"ET4%,ΦϦΤϯςʔγϣϯ
αϚϦʔ w ΫϥεͷϝιουςʔϒϧΛॻ͖͑Δ w ڧྗͰ͋ΔͨΊཚ༻Λආ͚Δ͖ w ඞͣަલͷϝιʔυΛݺͼ·͢ w ΫϥεͷΧςΰϦʔͱ MPBE࿈ܞ͕Φεεϝ
'"2 NBJMXFJXBOH!MJOFDPSQDPN )JQ$IBUPOFWDBU %FNPDPEFIUUQTHJUIVCDPNPOFWDBU-BOETDBQF7JFX$POUSPMMFS%FNP