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
Safer Objective-C
Search
Błażej Biesiada
January 27, 2014
Programming
0
130
Safer Objective-C
Few tips on how to make your Objective-C code safer at compile time.
Błażej Biesiada
January 27, 2014
Tweet
Share
More Decks by Błażej Biesiada
See All by Błażej Biesiada
Objective-C Runtime Hacking
bejo
1
460
Other Decks in Programming
See All in Programming
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
250
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
970
メルカリのリーダビリティチームが取り組む、AI時代のスケーラブルな品質文化
cloverrose
2
510
dchart: charts from deck markup
ajstarks
3
990
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
組織で育むオブザーバビリティ
ryota_hnk
0
170
CSC307 Lecture 08
javiergs
PRO
0
670
ぼくの開発環境2026
yuzneri
0
100
Featured
See All Featured
Speed Design
sergeychernyshev
33
1.5k
The agentic SEO stack - context over prompts
schlessera
0
630
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Code Reviewing Like a Champion
maltzj
527
40k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
54
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
WCS-LA-2024
lcolladotor
0
450
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Transcript
Safer Objective-C Błażej Biesiada @_bejo bejo
None
Compile Time Error Checking
Dynamic binding - (void)processArray:(NSArray *)array { for(id object in array)
{ [object process]; } }
“Static” binding - (void)processArray:(NSArray *)array { for(MyObject *object in array)
{ [object process]; } }
Key Paths [object addObserver:self forKeyPath:@"processed" options:0 context:nil];
libextobjc The Extended Objective-C library ! github.com/jspahrsummers/libextobjc
Safer Key Paths [object addObserver:self forKeyPath:@keypath(object.processed) options:0 context:nil];
Selectors [nc addObserver:self selector:@selector(process:) name:@"MyNotification" object:nil];
Safer Selectors [nc addObserver:self selector:@checkselector(self, process:) name:@"MyNotification" object:nil];
Safety first!
Compiler flags - Wall - Wextra - Werror - Wno-unused-parameter
Clang Static Analyzer
Runtime safety
NSNull NSDictionary *dict; dict = @{@"key" : [NSNull null]}; !
id val = dict[@"key"]; [val description];
Safer NSNull NSDictionary *dict; dict = @{@"key" : [EXTNil null]};
! id val = dict[@"key"]; [val description];
Thanks and see you at CocoaHeads Kraków! www.meetup.com/CocoaHeads-Krakow