We examine these sub tools of Apple’s Software Development Kit (SDK) in this workshop.
→ Apple LLVM compiler
→ Programming languages
→ Cocoa Touch
→ Assistant editor
→ Standard editor
Apple LLVM Compiler
The Apple LLVM compiler builds your app when you click the Run button of Xcode’s Toolbar process C and Objective code you enter in a class file.
As you write code, the compiler helps you out by
- displaying accurate code completion
- highlighting syntax
- displaying errors and suggests correct code syntax to use
Three programming languages are embedded in the SDK, but we only use two of them to write code for an iOS application to make its user interfaces functional.
C is a procedural programming language, where as Objective-C is an object oriented programming language. From now on when I use the term “Objective-C” or “OC” to reference both languages.
OC is a compiled language. This means that once you’ve written OC source code in a class file, you must run it through the the Apple LLVM compiler to turn it into an executable program the hand-held device’s operating system can run (execute). The OC source code is the human-readable form, while the executable that comes out of the compiler is the machine-executable form. This image shows how the Apple LLVM compiler converts Objective-C source code into an executable file.
Here is how steps in above image works.
- The programmer use his computer and Xcode’s Standard code editor to enter code in a class file.
- The OC Compiler converts the class file’s code into an object file by a process known as compiling.
- The Linker then converts the object file into an executable file by a process known as linking. An executable file is sometimes called a binary file.
By the way, the Apple LLVM compiler and linker is built right into Xcode.
Cocoa Touch is a collection of frameworks. When you create a new project, Xcode adds the Frameworks folder in the Xcode’s Navigator panel for you. If you expand it, you will see three frameworks listed there. In your day-to-day app development, you will use the UIKit and the Foundation frameworks often.
The UIKit Framework
This framework contain classes used for instantiating UIControls. Instantiating means creating. For example; when you use Interface Builder to drag a UITextField control from the Object Library and drop it on the a view’s canvas, you are instantiating (creating) a copy of that control. The Object Library provides access to the UIKit framework’s class for instantiating UI controls. This image shows partial list of UI controls you’ll find in Xcode’s Object Library.
You’ve learned how to used some of them in the AppDemo application you created in the Create an ios App workshop. In future lessons, you will learn how to use more UI controls.
The Foundation Framework
This framework provides classes for creating objects which you use to store data the app will use. Here is partial list of classes you will find in the Foundation framework.
For example, the NSString class is used for instantiate a string object, which you use for storing a string of text or numbers. In upcoming workshops, I will show you how to use classes of the framework you will use in your day-to-day app development.
The assistant editor automate the process of doing the following, so you don’t have do them manually.
- Define IBOutlet property variables and IBAction methods in a class’ interface file.
- Implement IBAction methods in the class’ implementation file.
- Connect IBOutlet and IBAction methods to Interface Builder File’s Owner object.
You can also use the Assistant Editor to load two different files side by side, so you can create IBOutlet and IBaction methods. By the way, Xcode automatically connect outlet properties and action methods you create in the interface file.
This is the editor you use 90% of the time to write Objective-C code in an interface and implementation file.
The Debugger is a window that’s automatically displayed at the bottom area of the Xcode’s Workspace. You can click the Debugger button, on Xcode’s Toolbar to show/hide it. It gives you the ability to stop your program mid-stream, examine the values of variables, and investigate the aftermath of errors that prevent your application from running in the iPhone/iPad Simulator.