Changes

The Basics of Modern Objective-C

50 bytes added, 17:30, 2 October 2012
no edit summary
The preceding two chapters have provided an introduction to Objective-C for readers that are new to encountering the languagefor the first time. This chapter , however, is intended for those programmers familiar with Objective-C 2.0 who would like to get a quick overview of some of the new features added to the language to coincide with the release of the iOS 6 SDK. These changes have combined to create what, for want of a better description, has come to be referred to as “Modern Objective-C”
Whilst an in-depth analysis of all the changes in Modern Objective-C is beyond the scope of this book, it is intended that this chapter will cover some key features that will make your life easier as an iOS developer.
== Method Ordering ==
Method ordering refers to the positions in which methods are declared relative to each other within an Objective-C source file. In previous versions of the language, a method had to be declared above any points in the code file from which it was called. Placing a method after a location where it was called resulted in a compilation error.
Historically, the following code would result in a compilation error stating that the method named flushBuffer could not be found:
The Objective-C compiler version that accompanies the iOS 6 SDK includes a number of improvements designed to make code easier to read and to minimize the amount of typing required by the programmer. This chapter has covered some of the key features added to what is referred to as Modern Objective-C. Where appropriate, the code examples in the remainder of this book will use Modern Objective-C syntax.