Preface |
|
xii | |
Chapter 1 Launching and Getting Started |
|
1 | (14) |
|
|
2 | (1) |
|
Registering as a Developer |
|
|
3 | (1) |
|
Registering as an Apple Developer |
|
|
3 | (1) |
|
Registering as an iOS Developer |
|
|
3 | (1) |
|
An Introduction to Xcode and the IOS SDK |
|
|
4 | (1) |
|
Creating and Running a Project in Xcode |
|
|
5 | (5) |
|
Getting to Know the Debugger |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
12 | (3) |
Chapter 2 Data Types and Arithmetic Expressions |
|
15 | (34) |
|
|
16 | (1) |
|
|
16 | (8) |
|
|
18 | (3) |
|
|
21 | (3) |
|
|
24 | (2) |
|
Preprocessor: # define statement |
|
|
26 | (1) |
|
|
26 | (8) |
|
|
26 | (2) |
|
|
28 | (2) |
|
Compound Assignment Operators |
|
|
30 | (4) |
|
|
34 | (7) |
|
Variable Declarations and initializations |
|
|
34 | (1) |
|
Implementation of Basic Data Types |
|
|
34 | (1) |
|
Implementation of Derived Data Types |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
Implementation Using Derived Data Types |
|
|
37 | (1) |
|
Implementation of Compound Operator |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
38 | (2) |
|
|
40 | (1) |
|
|
41 | (1) |
|
|
42 | (2) |
|
|
44 | (3) |
|
|
47 | (2) |
Chapter 3 Decisions and Conditions |
|
49 | (28) |
|
|
50 | (1) |
|
Assignment and Test for Equality Operator |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
51 | (3) |
|
|
54 | (2) |
|
|
56 | (2) |
|
|
58 | (3) |
|
|
61 | (1) |
|
Buffer Overflow with scanf When Reading a char |
|
|
62 | (1) |
|
|
62 | (6) |
|
|
63 | (1) |
|
|
63 | (2) |
|
|
65 | (3) |
|
|
68 | (1) |
|
|
68 | (1) |
|
|
69 | (3) |
|
|
72 | (3) |
|
|
75 | (2) |
Chapter 4 Looping |
|
77 | (24) |
|
|
78 | (1) |
|
Counter-Controlled for Loop |
|
|
79 | (5) |
|
|
81 | (2) |
|
|
83 | (1) |
|
Condition-Controlled Loop |
|
|
84 | (3) |
|
|
84 | (3) |
|
|
87 | (3) |
|
|
90 | (3) |
|
|
93 | (3) |
|
|
93 | (1) |
|
|
93 | (2) |
|
|
95 | (1) |
|
|
96 | (1) |
|
|
96 | (2) |
|
|
98 | (1) |
|
|
99 | (2) |
Chapter 5 Functions |
|
101 | (28) |
|
An Introduction to Functions |
|
|
102 | (1) |
|
|
103 | (4) |
|
|
107 | (1) |
|
|
107 | (1) |
|
Implementing Functions in an Existing Program |
|
|
108 | (3) |
|
|
111 | (2) |
|
|
113 | (7) |
|
|
113 | (1) |
|
|
114 | (1) |
|
|
115 | (1) |
|
|
115 | (1) |
|
|
116 | (1) |
|
|
116 | (1) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
117 | (2) |
|
|
119 | (1) |
|
|
120 | (1) |
|
|
120 | (3) |
|
|
123 | (4) |
|
|
127 | (2) |
Chapter 6 Foundation Framework |
|
129 | (30) |
|
|
130 | (2) |
|
Introduction to the Foundation Framework |
|
|
132 | (1) |
|
|
133 | (1) |
|
|
133 | (3) |
|
|
136 | (8) |
|
|
136 | (1) |
|
Create a Mutable Array from an Immutable Array |
|
|
137 | (1) |
|
Array Insertions and Additions |
|
|
138 | (2) |
|
|
140 | (2) |
|
|
142 | (2) |
|
|
144 | (1) |
|
|
145 | (3) |
|
|
148 | (4) |
|
Array Creation and Population |
|
|
149 | (1) |
|
Dictionary Creation and Population |
|
|
149 | (1) |
|
|
150 | (1) |
|
|
150 | (1) |
|
Use a for Loop to Print the Dictionary's Contents |
|
|
151 | (1) |
|
|
151 | (1) |
|
|
152 | (1) |
|
|
153 | (1) |
|
|
153 | (3) |
|
|
156 | (2) |
|
|
158 | (1) |
Chapter 7 Object-Oriented Programming |
|
159 | (42) |
|
Encapsulation, Objects, Instances, and Methods |
|
|
160 | (1) |
|
Instance and Class Methods |
|
|
161 | (2) |
|
|
161 | (1) |
|
Calling/Invoking Methods - Messaging |
|
|
162 | (1) |
|
Class Creation: @interface and @implementation |
|
|
163 | (4) |
|
Creating the @interface and @implementation Files |
|
|
164 | (1) |
|
Creating a Simple Dog Class |
|
|
165 | (2) |
|
Accessing Instance Variables |
|
|
167 | (1) |
|
|
168 | (2) |
|
Initializers/Constructors |
|
|
170 | (1) |
|
|
170 | (1) |
|
|
171 | (1) |
|
Using the description Method to Print an Object |
|
|
172 | (1) |
|
Complete Code for the Dog Class |
|
|
173 | (3) |
|
|
176 | (15) |
|
First Tier of Inheritance: Inheritance from NSObject |
|
|
177 | (3) |
|
Second Tier of Inheritance: Inheriting from a Class |
|
|
180 | (1) |
|
Creation of Another Subclass at the Second Tier |
|
|
181 | (1) |
|
Third Tier of Inheritance |
|
|
182 | (9) |
|
|
191 | (4) |
|
Creating the @interface File |
|
|
191 | (1) |
|
Creating the @implementation File |
|
|
192 | (1) |
|
Creating the main Function |
|
|
193 | (1) |
|
|
194 | (1) |
|
|
195 | (1) |
|
|
196 | (2) |
|
|
198 | (2) |
|
|
200 | (1) |
Chapter 8 Working in the iOS Environment |
|
201 | (34) |
|
iOS Platform and Architecture |
|
|
202 | (2) |
|
|
202 | (1) |
|
Role of Cocoa Touch and iOS layers |
|
|
202 | (2) |
|
iOS Software Development Kit (SDK) |
|
|
204 | (3) |
|
|
204 | (1) |
|
|
204 | (1) |
|
|
205 | (1) |
|
|
206 | (1) |
|
|
207 | (1) |
|
|
207 | (1) |
|
Views, View Controllers, IBOutlet Connections, and IBAction Connections |
|
|
208 | (2) |
|
Creating and Using IBOuti et and the IBAction Connections |
|
|
210 | (1) |
|
|
210 | (6) |
|
|
216 | (1) |
|
|
216 | (1) |
|
|
217 | (1) |
|
|
217 | (1) |
|
|
217 | (14) |
|
|
229 | (2) |
|
|
231 | (1) |
|
|
232 | (1) |
|
|
232 | (1) |
|
|
233 | (2) |
Chapter 9 Understanding and Creating User Interfaces |
|
235 | (46) |
|
|
236 | (1) |
|
|
236 | (18) |
|
A Simple Transition Using Storyboards |
|
|
238 | (9) |
|
Storyboard Example with Navigation Bars |
|
|
247 | (7) |
|
Passing Data Between Views |
|
|
254 | (12) |
|
|
266 | (10) |
|
|
267 | (1) |
|
Adding Controls to the View Controller |
|
|
267 | (1) |
|
|
268 | (1) |
|
|
269 | (1) |
|
|
270 | (1) |
|
Coding the Transition from View 1 to View 2 |
|
|
270 | (1) |
|
|
271 | (5) |
|
|
276 | (1) |
|
|
276 | (1) |
|
|
277 | (2) |
|
|
279 | (2) |
Chapter 10 Passing Data Between View Controllers, Delegates, and Protocols |
|
281 | (36) |
|
|
282 | (1) |
|
Presenting and Dismissing View Controllers |
|
|
282 | (1) |
|
Creating Transitions Without Storyboards |
|
|
282 | (9) |
|
View Controller Communication |
|
|
290 | (1) |
|
|
291 | (1) |
|
Summary of Steps for Using Protocols and Delegates |
|
|
292 | (2) |
|
|
293 | (1) |
|
|
294 | (1) |
|
Using Delegates to Pass Data Between Views |
|
|
294 | (9) |
|
Implementing the Flow of Data |
|
|
296 | (1) |
|
|
297 | (1) |
|
Writing the viewDidLoad Method and Running the App |
|
|
297 | (1) |
|
Declaring the Protocol and Invoking the Protocol Method |
|
|
298 | (2) |
|
|
300 | (3) |
|
|
303 | (2) |
|
Dismiss Keyboard from Within a Text Field |
|
|
303 | (1) |
|
Dismiss the Keyboard by Touching Anywhere on the Screen |
|
|
304 | (1) |
|
|
305 | (8) |
|
|
305 | (1) |
|
Design the User Interface for View Controller 1 |
|
|
306 | (1) |
|
Design the User Interface for View Controller 2 |
|
|
307 | (1) |
|
Protocol and Delegate Implementation |
|
|
308 | (1) |
|
|
309 | (1) |
|
Coding the Compute Button in SecondViewController |
|
|
310 | (3) |
|
|
313 | (1) |
|
|
314 | (1) |
|
|
314 | (1) |
|
|
315 | (2) |
Chapter 11 Table Views |
|
317 | (40) |
|
|
318 | (2) |
|
|
320 | (1) |
|
Creating an App with a Table View |
|
|
321 | (11) |
|
|
322 | (2) |
|
Programming the Table View |
|
|
324 | (3) |
|
Displaying Data in the Table View |
|
|
327 | (1) |
|
|
328 | (2) |
|
Code for the TableViewController.m Files |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
332 | (1) |
|
Creating a Master-Detail Application Example |
|
|
333 | (10) |
|
Implementing the Master-Detail-Application Template |
|
|
337 | (3) |
|
MasterViewController.h file |
|
|
340 | (1) |
|
MasterViewController.m file |
|
|
340 | (2) |
|
|
342 | (1) |
|
|
343 | (6) |
|
Create a New Project and Design the Interface |
|
|
345 | (1) |
|
Add the View Controller Files |
|
|
345 | (1) |
|
|
345 | (1) |
|
Create IBOutlet and IBAction Connections |
|
|
345 | (1) |
|
|
346 | (1) |
|
Implement the IBAction Connection |
|
|
346 | (1) |
|
Program the Master View Controller to Display Data |
|
|
347 | (1) |
|
Transfer Data Between Views |
|
|
348 | (1) |
|
|
349 | (4) |
|
|
353 | (1) |
|
|
354 | (1) |
|
|
355 | (1) |
|
|
356 | (1) |
Chapter 12 Tab Bar View and Picker View Controls |
|
357 | (40) |
|
|
358 | (2) |
|
Creating a Tab Bar App Using Storyboards |
|
|
360 | (9) |
|
Starting a Tab Bar App Example |
|
|
360 | (5) |
|
|
365 | (4) |
|
Creating a Tab Bar Without Storyboards |
|
|
369 | (5) |
|
Tab Bar and Navigation View Controller Example |
|
|
370 | (2) |
|
Complete AppDelegate.m File |
|
|
372 | (1) |
|
|
373 | (1) |
|
Complete ThirdViewController.m File |
|
|
373 | (1) |
|
|
374 | (1) |
|
|
374 | (8) |
|
Using a Delegate and a Data Source with a Picker View |
|
|
375 | (1) |
|
Creating an App with a Picker View |
|
|
376 | (4) |
|
|
380 | (2) |
|
|
382 | (11) |
|
Adding an Image and Title to the Tabs |
|
|
384 | (1) |
|
Embedding a Navigation controller |
|
|
385 | (1) |
|
|
385 | (1) |
|
Populating the Table View |
|
|
386 | (1) |
|
|
387 | (5) |
|
|
392 | (1) |
|
|
393 | (1) |
|
|
394 | (1) |
|
|
395 | (1) |
|
|
396 | (1) |
Chapter 13 Creating Multimedia Apps with Images and Sound |
|
397 | (42) |
|
|
398 | (6) |
|
|
404 | (13) |
|
|
405 | (1) |
|
Creating an App that Plays Audio |
|
|
405 | (1) |
|
Add the AVFoundation Framework |
|
|
406 | (3) |
|
|
409 | (1) |
|
Create and Program the Play Button |
|
|
409 | (1) |
|
Prepare to Program the Play Button |
|
|
410 | (1) |
|
|
410 | (1) |
|
Adding Volume Control to the App |
|
|
411 | (2) |
|
|
413 | (1) |
|
|
414 | (2) |
|
|
416 | (1) |
|
|
417 | (5) |
|
|
417 | (1) |
|
Creating an App that Plays Video |
|
|
417 | (1) |
|
Add MediaPlayer framework |
|
|
418 | (1) |
|
Create and Program a Play Button |
|
|
419 | (1) |
|
|
420 | (2) |
|
|
422 | (13) |
|
|
423 | (1) |
|
|
423 | (1) |
|
Adding Frameworks for Audio and Media |
|
|
424 | (1) |
|
|
424 | (3) |
|
Program the Second View Controller in the SecondViewController.h File |
|
|
427 | (1) |
|
Add Data to the Picker View |
|
|
427 | (1) |
|
SecondViewControlLer.h File |
|
|
427 | (1) |
|
Synthesize All the Properties |
|
|
428 | (4) |
|
Designing the Third View Controller |
|
|
432 | (1) |
|
Programming the Third View Controller in the ThirdViewController.h file |
|
|
433 | (1) |
|
Adding Data to the Picker View |
|
|
433 | (1) |
|
Programming the Third View Controller in the ThirdViewController.h File |
|
|
433 | (2) |
|
|
435 | (1) |
|
|
436 | (1) |
|
|
437 | (1) |
|
|
438 | (1) |
Chapter 14 Data Persistence |
|
439 | (54) |
|
Data Persistence Mechanisms |
|
|
440 | (1) |
|
|
440 | (6) |
|
Writing Data to a NSUserDefaul is Object |
|
|
441 | (1) |
|
Creating a NSUserDefaults Example App |
|
|
441 | (5) |
|
|
446 | (8) |
|
Creating a Plist Example App |
|
|
447 | (1) |
|
Adding Items to a Property List |
|
|
448 | (1) |
|
|
449 | (5) |
|
|
454 | (5) |
|
Creating an Archiving Example App |
|
|
454 | (5) |
|
|
459 | (9) |
|
Creating a SQLite Example |
|
|
459 | (9) |
|
|
468 | (20) |
|
Design the User Interface |
|
|
470 | (4) |
|
Add the SQLite Database Library |
|
|
474 | (1) |
|
Programming the MainViewController.h file |
|
|
474 | (1) |
|
Program the MainViewController.m file |
|
|
475 | (5) |
|
Writing the Code for the FlipsideViewController.h File |
|
|
480 | (1) |
|
Writing the Code for the FlipsideViewController.m File |
|
|
481 | (2) |
|
Writing the viewDidLoad Method |
|
|
483 | (5) |
|
Running the Completed App |
|
|
488 | (1) |
|
|
488 | (1) |
|
|
489 | (1) |
|
|
490 | (1) |
|
|
491 | (2) |
Appendix A Xcode Debugger |
|
493 | (8) |
Index |
|
501 | |