

Failing to release an object would result in memory leaks (whereby a running application’s memory usage increases over time), whilst releasing an object too soon typically caused an application to crash. This typically entailed manually adding retain and release method calls to code in order to manage memory usage. Also verify that the Use Automatic Reference Counting option is selected.īefore Automatic Reference Counting (ARC) support was introduced to recent versions of Apple’s compiler, an Objective-C programmer was responsible for retaining and releasing objects in application code. Within the template selection screen, select the Application entry listed beneath MacOS X in the left hand panel followed by Command Line Tool in the main panel:Ĭlick Next and on the resulting options panel name the project sampleApp and select Foundation from the Type menu. Once Xcode has loaded, and assuming this is the first time you have used Xcode on this system, you will be presented with the Welcome screen from which you are ready to proceed:Ĭlick on the option to Create a new Xcode project to display the template selection screen. Click on the Xcode icon in the dock to launch the tool. Since you will be making frequent use of this tool, take this opportunity to drag and drop it into your dock for easier access in the future. To start up Xcode, open the Finder and search for Xcode. Having successfully installed the SDK and Xcode, the next step is to launch it so that we can write and then create a sample iPhone application. In this chapter we will cover the steps involved in installing Xcode and writing and compiling a simple Objective-C program in this environment. Xcode is a powerful and easy to use development environment that is available for a minimal charge to anyone fortunate enough to own an Apple computer running Mac OS X.

Perhaps the biggest advantage of using Mac OS X as your Objective-C learning platform (aside from the ability to develop iOS and Mac OS X applications) is the fact that you get to use Apple's Xcode development tool. If you are planning to develop iOS applications (or Mac OS X applications for that matter), however, you are going to need to use an Intel based Mac OS X system at some point in the future. In later chapters we will look at how to install and use Objective-C on Windows and Linux systems for those that do not have access to Mac OS X. Objective-C 2.0 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters. Purchase the full edition of this Objective-C book in Print ($14.99) or eBook ($12.99) format
