## Essential Skills--Made Easy! Create your own iPhone and Mac OS X applications with ease. Objective-C for iPhone Developers: A Beginner's Guide shows you how to use the Objective-C programming language, Apple's Foundation framework, the iPhone SDK, and the Xcode development environment. The first stop for aspiring iPhone developers, this hands-on guide teaches you how to create versatile, innovative, and marketable apps in no time. Real-world examples throughout the book correspond with downloadable Xcode projects and video tutorials so you can get started with your first app right away. Designed for Easy Learning* **Key Skills & Concepts --Chapter-opening lists of specific skills covered in the chapter * **Ask the Expert --Q&A sections filled with bonus information and helpful tips * **Try This --Hands-on exercises that show you how to apply your skills * **Notes --Extra information related to the topic being covered * **Tips --Helpful reminders or alternative ways of doing things * **Annotated Syntax --Example code with commentary that describes the programming techniques being illustrated************ Ready-to-use code at www.mhprofessional.com/computingdownload and www.jamesabrannan.com Contents......Page 8 Acknowledgments......Page 12 Introduction......Page 14 1 Exploring the iPhone SDK and Basic Programming......Page 20 Downloading the SDK......Page 22 SDK Documentation......Page 24 Wikipedia......Page 25 The iPhone Dev SDK Forum......Page 26 A Simple C Program......Page 29 Variables......Page 31 Functions......Page 32 Objective-C’s Main Method......Page 34 Header Files and Source Files......Page 37 Xcode Fundamentals......Page 40 Configuring Xcode’s Display......Page 42 Exploring Xcode Further......Page 45 2 Primitive Data Types and Operators......Page 46 Primitive Data Types......Page 47 Numeric Types: Integers......Page 48 Numeric Types: Float and Double......Page 52 Characters......Page 54 Arithmetic Operators......Page 55 Unary Operators......Page 57 Equality and Logical Operators......Page 58 Assignment Operators......Page 59 Data Type Conversions......Page 60 The UIWindow Application Template......Page 61 3 Flow Control Statements, Arrays, and Structures......Page 66 Boolean Expressions......Page 68 The For Loop......Page 69 The While Loop......Page 70 The Do While Loop......Page 71 Conditional Statements......Page 75 The If Statement......Page 76 The If Else If Else Structure......Page 78 The Switch Statement......Page 80 The Break and Continue Statements......Page 83 Arrays and Structures......Page 84 Arrays......Page 85 The Struct Keyword......Page 87 The UIViewController’s Life-Cycle Methods......Page 90 4 Classes, Objects, and Messaging......Page 94 Procedural Programming......Page 96 Object-Oriented Programming: Classes and Objects......Page 98 Object-Oriented Analysis......Page 100 Classes and Objects......Page 101 The @interface......Page 102 Object-Oriented Programming: Behavior......Page 103 Class Interaction......Page 104 The @class Directive......Page 109 Methods and Messaging......Page 114 Class and Instance Methods......Page 115 Allocating and Initializing Objects......Page 118 Writing Custom Initializers......Page 119 Multiple Argument Methods......Page 122 5 Memory Management and Properties......Page 130 Memory Management......Page 131 Manual Memory Management......Page 132 Encapsulation and Memory Management......Page 140 Declaring Properties......Page 144 Dot Notation......Page 145 Property Attributes......Page 146 Ownership and Properties Revisited......Page 150 Autorelease and Pools......Page 151 Autorelease and Custom Classes......Page 152 IBOutlet and Interface Builder......Page 157 Deallocating and Nil Revisited......Page 162 6 Inheritance......Page 164 Inheritance Explained......Page 165 Inheriting Properties......Page 175 Extension......Page 178 Replacing a Parent’s Method......Page 181 Extending a Parent’s Method......Page 182 No Overriding Instance Variables and No Overloading......Page 185 No Method Overloading......Page 186 Inheritance and UIViewController......Page 187 7 Protocols and Categories......Page 192 Protocols......Page 193 Syntax......Page 194 Adopting a Protocol......Page 195 Properties and Protocols......Page 205 Optional Methods......Page 207 Protocols and id......Page 211 Adopting Multiple Protocols......Page 212 Extending Protocols......Page 216 Protocols and Delegates in UIKit......Page 220 Categories......Page 226 Categories Explained......Page 227 8 Some Foundation Framework Classes......Page 232 NSString and NSMutableString......Page 234 NSNumber......Page 239 NSDate and NSDateFormatter......Page 241 NSArray and NSMutableArray......Page 243 NSEnumerator and Fast Enumeration......Page 247 NSDictionary and NSMutableDictionary......Page 250 9 File Handling......Page 256 iPhone Directories......Page 257 NSSearchPathForDirectoriesInDomains......Page 258 NSBundle......Page 259 NSFileManager......Page 260 NSString, Paths, and Text Files......Page 267 NSData......Page 273 10 Property Lists, NSCopy, and Archiving......Page 284 Property Lists......Page 285 Writing a Property List......Page 286 Reading a Property List......Page 287 Archiving......Page 297 NSKeyedArchiver and NSKeyedUnarchiver......Page 298 11 Selectors and Targets......Page 314 Selectors......Page 315 Delaying a Selector or Running in Background......Page 319 Notifications......Page 320 Delegates......Page 326 Target-Action......Page 330 12 The Model-View-Controller Design Pattern......Page 334 The Model-View-Controller Design Pattern......Page 335 Persistence......Page 343 Multiple Xibs......Page 347 A......Page 372 C......Page 373 F......Page 375 I......Page 376 L......Page 377 M......Page 378 N......Page 379 P......Page 380 R......Page 381 T......Page 382 V......Page 383 X......Page 384
Essential Skills—Made Easy!
Create your own iPhone and Mac OS X applications with ease. Objective-C for iPhone Developers: A Beginner's Guide shows you how to use the Objective-C programming language, Apple's Foundation framework, the iPhone SDK, and the Xcode development environment. The first stop for aspiring iPhone developers, this hands-on guide teaches you how to create versatile, innovative, and marketable apps in no time. Real-world examples throughout the book correspond with downloadable Xcode projects and video tutorials so you can get started with your first app right away.
Designed for Easy Learning
- Key Skills & Concepts—Chapter-opening lists of specific skills covered in the chapter
- Ask the Expert—Q&A sections filled with bonus information and helpful tips
- Try This—Hands-on exercises that show you how to apply your skills
- Notes—Extra information related to the topic being covered
- Tips—Helpful reminders or alternative ways of doing things
- Annotated Syntax—Example code with commentary that describes the programming techniques being illustrated
Ready-to-use code at www.mhprofessional.com/computingdownload and www.jamesabrannan.com
Create your own iPhone and Mac OS X applications with ease. Objective-C for iPhone A Beginner's Guide shows you how to use the Objective-C programming language, Apple's Foundation framework, the iPhone SDK, and the Xcode development environment. The first stop for aspiring iPhone developers, this hands-on guide teaches you how to create versatile, innovative, and marketable apps in no time. Real-world examples throughout the book correspond with downloadable Xcode projects and video tutorials so you can get started with your first app right away. Designed for Easy Learning Ready-to-use code at (http://www.mhprofessional.com/computingdownload) www.mhprofessional.com/computingdownload and (http://www.jamesabrannan.com) www.jamesabrannan.com "Shows you how to use the Objective-C programming language, Apple's Foundation framework, the iPhone SDK, and the Xcode development environment. ... Real-world examples throughout the book correspond with downloadable Ccode projects and video tutorials so you can get started with your first app right away." I can't give a true review of this book, because I can't read it. At least on the iPad Kindle reader, the code listing has lost all formatting - all example code is mushed into one block of text. This makes it completely pointless.