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
Juan Pablo Ortiz Aréchiga
March 24, 2012
Programming
5
160
Objective-C Introduction part1
An extended -barely- version of the Objective-C introduction at CocoaHeadsGDL.
Juan Pablo Ortiz Aréchiga
March 24, 2012
Tweet
Share
More Decks by Juan Pablo Ortiz Aréchiga
See All by Juan Pablo Ortiz Aréchiga
Introduction to programming
pablasso
1
66
Objective-C Introduction part2
pablasso
3
130
Objective-C at CocoaHeadsGDL
pablasso
1
110
Other Decks in Programming
See All in Programming
雑に思考を整理する技術と効能
konifar
52
23k
SpringBoot+MyBatisで例外が出たときどこを見るか
syukai
0
110
HUIT新歓2024「競技プログラミング、やってみませんか?」
slephy2784
1
250
オブジェクト指向のリ・オリエンテーション~歴史を振り返り、AI時代に向きなおる~
hanyudaeiiti
9
5.6k
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
210
ゆるい個人開発のススメ
kuroppe1819
10
930
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
410
受託開発でGitLab CI を活用していく
xiombatsg
1
260
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
330
Introduction for Open Source Swift Workshop
giginet
PRO
0
1.1k
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
1.1k
[SF Ruby, March 2024] Rails on Wasm
palkan
0
360
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
645
57k
Building Effective Engineering Teams - LeadDev
addyosmani
26
1.8k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.3k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
Ruby is Unlike a Banana
tanoku
95
10k
Designing with Data
zakiwarfel
95
4.8k
Documentation Writing (for coders)
carmenintech
59
3.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
GraphQLの誤解/rethinking-graphql
sonatard
49
9.2k
A Modern Web Designer's Workflow
chriscoyier
689
190k
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