Appendix A
Whats on the DVD?
This appendix provides you with information on the contents of the DVD that accompanies the print book. For the most up-to-date information please refer to the ReadMe file located at the root of the DVD. Here is what you will find in this appendix:
- Using the DVD
- Whats on the DVD
- Troubleshooting
System Requirements
Most reasonably up-to-date computers with a DVD drive should be able to play the screencasts that are included on the DVD. You may also find an Internet connection helpful for downloading updates to this book. To follow the exercises covered in the screencasts you will need to have the iOS 5 SDK installed on your Mac. Instructions on downloading and installing the iOS 5 SDK are provided in Lesson 1.
Using the DVD on a PC
To access the content from the DVD, follow these steps:
Insert the DVD into your computers DVD-ROM drive. The license agreement will appear.
The interface won't launch if you have autorun disabled. In that case click Start Run (For Windows Vista, Start All Programs Accessories Run). In the dialog box that appears, type D:\Start.exe . (Replace D with the proper letter if your DVD drive uses a different letter. If you don't know the letter, see how your CD drive is listed under My Computer.) Click OK.
Read through the license agreement, and click the Accept button if you want to use the DVD.
The DVD interface appears. Simply select the lesson video you want to view.
Using the DVD on a Mac
To install the items from the DVD to your hard drive, follow these steps:
Insert the DVD into your computer's DVD-ROM drive.
The DVD icon will appear on your desktop; double-click to open.
Double-click the Start button.
Read the license agreement and click the Accept button to use the DVD.
The DVD interface will appear. Here you can install the programs and run the demos.
Whats on the DVD
Most lessons in the book have a corresponding screencast that illustrates examples in the lesson and provides content beyond what is covered in print.
We recommend using the following steps when reading a lesson:
Read the lessons text.
Read the step-by-step instructions in the lessons Try It section.
Follow these instructions to make the code sample work on your computer.
Watch the screencast.
You can also download all the solutions to the Try It sections at the books website. If you get stuck and dont know what to do next, visit the p2p forums ( and gbacklin@marizack.com and well try to point you in the right direction.
Troubleshooting
If you have difficulty installing or using any of the materials on the companion DVD, try the following solutions:
- Turn off any antivirus software that you may have running: Installers sometimes mimic virus activity and can make your computer incorrectly believe that it is being attacked by a virus. (Be sure to turn the antivirus software back on later.)
- Close all running programs: The more programs youre running, the less memory is available to other programs. Installers also typically update files and programs; if you keep other programs running, installation may not work properly.
- Reference the ReadMe: Please refer to the ReadMe file located at the root of the CD-ROM for the latest product information as of publication time.
- Reboot if necessary: If all else fails, rebooting your machine can often clear any conflicts in the system.
Customer Care
If you have trouble with the CD-ROM please call the Wiley Product Technical Support phone number, (800) 762-2974. Outside the United States call 1 (317) 572-3994. You can also contact Wiley Product Technical Support at http://support.wiley.com . John Wiley & Sons will provide technical support only for installation and other general quality-control issues. For technical support on the applications themselves, consult the programs vendor or author.
To place additional orders or to request information about other Wiley products, please call (877) 762-2974.
Appendix B
Introduction to Programming with Objective-C
In this appendix, you learn some of the key concepts of computer programming and the fundamentals of the Objective-C language. Objective-C is the language of choice when it comes to iOS programming. It is an object-oriented language and was invented in the early 80s by Brad Cox.
Essentially, Objective-C is an extension of the C language designed to give it object-oriented capabilities by bringing in concepts from another popular programming language in the 80sSmalltalk. Objective-C development coincided with the development of the popular C++ language, thus Objective-C and C++ share many common concepts. A brief timeline of the Objective-C language is shown in .
Fundamental Programming Concepts
To create anything more than the simplest of iOS applications requires you to know how to write programs. A program is a set of instructions to the device to carry out a specific task, and these instructions are specified using a programming language.
Fundamentally, computers are electronic devices, and only understand a language of 1s and 0s (known as binary language ). In the early days of computer programming, programmers would have to provide their instructions in this binary languagea process that was both tedious and error prone.
As time went by, sequences of binary digits were given three-character names (like MOV and ADD) to create a higher-level language called assembly language. Programs were written using these names, and then converted to binary language before being given to the computer. These higher-level languages were easier to use by programmers.
Over the decades, several high-level, verbose languages were developed, each getting closer to instructions that began to resemble words we use in our everyday lives (like if, while, do, and return). Today almost all programming is done in one high-level language or the other (such as C, C++, Java, C#, or Objective-C). Creating an application requires a few common steps, regardless of the language in which you write your code. Sometimes one or more of these steps are combined into a single step.
Typing Your Program
The first step in creating an application is typing your code in a suitable text editor. This code that you type is essentially a series of instructions to the iOS device to perform certain tasks, and is known as source code .
Compiling
Objective-C is a high-level programming language. This means that the computer cannot directly understand Objective-C. A computer requires digital/binary instructions (also known as binary language, or machine language ), and before your Objective-C code can run on an iOS device, it needs to be converted into machine language.
This translation (from Objective-C to machine language) is performed by an application called a compiler , and the process is known as compilation . A compiler () basically takes as input your Objective-C source code and produces another file with machine language instructions (usually with an .obj extension).