Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
jspatch分享
Search
passol1988
March 11, 2017
Programming
31
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
jspatch分享
passol1988
March 11, 2017
More Decks by passol1988
See All by passol1988
callkit研究
passol1988
0
63
RN分享
passol1988
0
25
Other Decks in Programming
See All in Programming
ActionController meets Protocol Buffers
sorah
0
520
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
210
AWSに止められる覚悟してますか?
morizo_1984
2
540
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
残高管理から台帳サービスへの進化
artoy
1
200
Featured
See All Featured
Being A Developer After 40
akosma
92
590k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Optimising Largest Contentful Paint
csswizardry
37
4k
Building an army of robots
kneath
307
47k
Designing for Performance
lara
612
70k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Technical Leadership for Architectural Decision Making
baasie
3
600
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Typedesign – Prime Four
hannesfritz
42
3.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
objc runtimeګᅾๅෛ
ObjCᇙ ✦ձ֜Cᑕଧݢզፗള᭗ᬦObjective-Cᖫᦲ ✦Objective-CጱᶎݻဩრԭSmalltalkၾ௳փ᭓
ၾ௳փ᭓ [receiver message] objc_msgSend(receiver, @selector(message)); ((void (*)(id, SEL))(void *)objc_msgSend)((id)receiver,sel_registerName("message"));
ၾ௳փ᭓ id objc_msgSend(id receiver, SEL _cmd, ...) receiver ၾ௳ളݑᘏ _cmd
ڍහጱොဩݷ,Ӟᛱٟ֢selector … ݢݒ݇හڜᤒ
ၾ௳හഝᕮ id objc_msgSend(id receiver, SEL _cmd, ...) receiver ၾ௳ളݑᘏ _cmd
ڍහጱොဩݷ,Ӟᛱٟ֢selector … ݢݒ݇හڜᤒ
ᔄጱᕮ objcਫֺ objc-object objc-class isaᰒ objc-classᆿ isaᰒ ڍහݷ ڍහොဩ ړݎᤒ
ړݎᤒ static int function(objc * self, SEL message, …) {
…code } id objc_msgSend(id receiver, SEL _cmd, ...) ىᘶڍහݷڍහᰒIMP
ၾ௳փ᭓ ොဩᥴຉ resolveInstanceMethod resolveClassMethod ள᭛ၾ௳ݎ forwardingTargetForSelector ຽٵၾ௳ݎ methodSignatureForSelector forwardInvocation
ԧᥴᬩᤈጱঅ॒ ग़ᖀಥ Method Swizzling
JavaScriptCore JSContext ᔄ֒ԭ window JSValue ۸౮ݱ զڹጱ᭗מොୗ ڥአiframeٖୌjsጱොୗ JSExportܐᦓ
JSContext JSContext *context = [[JSContext alloc] init]; context[@"hello"] = ^(NSString
*msg) { NSLog(@"hello %@", msg); }; [_context evaluateScript:@"hello('word')"]; //output hello word
JSValue JSContext *context = [[JSContext alloc] init]; context[@"hello"] = ^(NSString
*msg) { NSLog(@"hello %@", msg); }; [_context evaluateScript:@"hello('word')"]; //output hello word
JSPatchսᗌᅩ js᭗አฃ ᒧݳຎਭ໐ᥢ ඪ೮block ӧඪ೮ios6
ӷᐿጱᕹӞ ڥአJSBoxingᤰ(୩୧, ᰒ҅ᔄ)
JPBoxing js᭗አฃ
JPBoxing js᭗አฃ
JPBoxing Objective-C Javascript formatOCToObj() formatOCToJS() formatOCToJS()