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 Introduction part1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Juan Pablo Ortiz Aréchiga
March 24, 2012
Programming
170
5
Share
Objective-C Introduction part1
An extended -barely- version of the Objective-C introduction at CocoaHeadsGDL.
Juan Pablo Ortiz Aréchiga
March 24, 2012
More Decks by Juan Pablo Ortiz Aréchiga
See All by Juan Pablo Ortiz Aréchiga
Introduction to programming
pablasso
1
81
Objective-C Introduction part2
pablasso
3
150
Objective-C at CocoaHeadsGDL
pablasso
1
130
Other Decks in Programming
See All in Programming
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
270
RTSPクライアントを自作してみた話
simotin13
0
290
TSKaigi 2026 TypeScriptバックエンドのオブザーバビリティ戦略 — Datadog × NestJSの実践
taiseiyamamotoan
1
200
要はバランスからの卒業 #yumemi_grow
kajitack
0
200
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.4k
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
3.4k
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.2k
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
2
950
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.7k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
200
AI 時代のソフトウェア設計の学び方
masuda220
PRO
28
10k
OSもどきOS
arkw
0
250
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
230
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
190
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Scaling GitHub
holman
464
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Leo the Paperboy
mayatellez
7
1.8k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
470
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
200
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Transcript
Objective-C intro viernes 23 de marzo de 12
History • Born in the 80’s by Brad Cox and
Tom Love • A C’s pre-processor • C + Smalltalk = Obj-C • Not really popular viernes 23 de marzo de 12
NeXT! viernes 23 de marzo de 12
• NeXT was a failure on hardware, but success on
building tools • GNU cloned the compiler in the 90s • Apple buys NeXT, relies Objective-C and NeXT tools viernes 23 de marzo de 12
Objective-C • Bunch of C extensions • You can write
plain C without problems • Interfaces (.h) and implementations (.m) viernes 23 de marzo de 12
Objective-C • Dynamic typing (id) viernes 23 de marzo de
12
Method syntax viernes 23 de marzo de 12
In Objective-C style: viernes 23 de marzo de 12
multiparameters viernes 23 de marzo de 12
Accessors the properties way the manual way viernes 23 de
marzo de 12
Properties instead of this.. viernes 23 de marzo de 12
Properties .. this setters/getters are created for you viernes 23
de marzo de 12
Properties set synthesize on the implementation avoids clutter viernes 23
de marzo de 12
Properties • nonatomic • atomic • retain • copy •
assign viernes 23 de marzo de 12
Memory management • It’s all up to you * viernes
23 de marzo de 12
Memory management reference counting viernes 23 de marzo de 12
Creating objects or autorelease Everytime you use init or retain,
it’s your responsability to release viernes 23 de marzo de 12
Memory management viernes 23 de marzo de 12
Interface 1 2 3 viernes 23 de marzo de 12
Implementation setters viernes 23 de marzo de 12
Implementation setters viernes 23 de marzo de 12
Implementation viernes 23 de marzo de 12
3 ways to handle memory • Manual reference counting •
Garbage collector* (only on Mac) • ARC viernes 23 de marzo de 12
ARC viernes 23 de marzo de 12
ARC • Memory Management? that’s so 2011 • Automatic Reference
Counting • Xcode 4.2+ • Compatible with iOS 4.x* and iOS 5.x viernes 23 de marzo de 12
Properties + ARC • atomic • nonatomic • weak •
strong viernes 23 de marzo de 12
Debug with NSLog same rules as printf() viernes 23 de
marzo de 12
nil every message sent to nil will be ignored, the
app won’t crash viernes 23 de marzo de 12
Categories add methods to an existing class without subclassing viernes
23 de marzo de 12
Categories Once imported, the category can be used on any
NSString viernes 23 de marzo de 12
Protocols • Declare methods that others are expected to implement
viernes 23 de marzo de 12
Delegate Pattern • Handing a task to another part of
the program. • i.e. a TableView may notify it’s delegate when a single row was tapped so the program can take an action. viernes 23 de marzo de 12
Coding Standards viernes 23 de marzo de 12
Coding Standards viernes 23 de marzo de 12
Coding Standards viernes 23 de marzo de 12