Objective-C Quick Syntax Reference - Matthew Campbell.pdf

(2688 KB) Pobierz
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author ............................................................................
xiii
About the Technical Reviewer .........................................................
xv
Introduction ...................................................................................
xvii
Chapter 1: Hello World ....................................................................
1
Chapter 2: Build and Run ................................................................
7
Chapter 3: Variables .....................................................................
11
Chapter 4: Operators ....................................................................
15
Chapter 5: Objects ........................................................................
19
Chapter 6: Strings.........................................................................
23
Chapter 7: Numbers......................................................................
27
Chapter 8: Arrays .........................................................................
29
Chapter 9: Dictionaries .................................................................
33
Chapter 10: For Loops ..................................................................
35
Chapter 11: While Loops ...............................................................
37
Chapter 12: Do While Loops..........................................................
39
Chapter 13: For-Each Loops .........................................................
41
Chapter 14: If Statements.............................................................
43
Chapter 15: Switch Statements ....................................................
45
Chapter 16: Defining Classes........................................................
49
v
CONTENTS AT A GLANCE
Chapter 17: Class Methods ...........................................................
57
Chapter 18: Inheritance ................................................................
59
Chapter 19: Categories .................................................................
65
Chapter 20: Blocks .......................................................................
69
Chapter 21: Key-Value Coding ......................................................
73
Chapter 22: Key-Value Observation ..............................................
75
Chapter 23: Protocols ...................................................................
81
Chapter 24: Delegation .................................................................
85
Chapter 25: Singleton ...................................................................
89
Chapter 26: Error Handling ...........................................................
91
Chapter 27: Background Processing ............................................
95
Chapter 28: Object Archiving........................................................
97
Chapter 29: Web Services...........................................................
101
Index ..............................................................................................
105
vi
Introduction
Objective-C is a tool that you can use to create stunning applications for the Mac, iPhone,
and iPad.
This
unique programming language traces its linage back to the C programming
language. Objective-C is C with object-oriented programming.
Today, learning programming is about learning how to shape our world. Objective-C
programmers are in a unique position to create mobile applications that people all over
the world can use in their daily lives.
Objective-C is a delight to use. While other programming languages can feel clumsy
at times, Objective-C will show you its power and reach with grace. Problems that seem
intractable in other programming languages melt away in Objective-C.
At its core, this book is about laying out, without any fuss, what Objective-C can do.
When you know what you want to do, but you just need to know the Objective-C way to
do it, use this book to get help.
xvii
Zgłoś jeśli naruszono regulamin