Synopses & Reviews
This is not your typical book on Apple's iOS. Whether you're building iPhone apps for the first time, or want a reference to bolster the Cocoa development skills you already have, this in-depth guide provides a complete learning path from app concept to finished product. You’ll learn language basics, how to use Xcode and Interface Builder, and all the steps necessary for developing your app with the Cocoa framework.
What's an Objective-C "protocol?" What are your code's memory-management responsibilities? How can you make a user interface similar to the iPhone Mail app? How do you prepare your app for submission to the App Store? This book covers everything in a rigorous, orderly fashion. It's ideal for beginners with no experience using Apple's tools, as well as experienced iPhone developers who want a comprehensive handbook that details every aspect of the process.
- Learn the steps needed to complete an iPhone, iPad, or iPod touch app, from initial concept to the App Store
- Become familiar with object-oriented programming concepts
- Get up to speed on Objective-C language details
- Develop on both the iPhone and iPad platforms, using the "universal app" approach
- Work effectively with Xcode, Interface Builder, and other tools in the iPhone SDK
- Get code examples that illustrate each of the concepts and API aspects discussed
Whether developers are building iPhone apps for the first time, or want a reference to bolster the Cocoa development skills they already have, this in-depth guide provides a learning path from beginning to end.
Get a solid grounding in all the fundamentals of Cocoa Touch, and avoid problems during iPhone and iPad app development. With Programming iOS 4, you'll dig into Cocoa and learn how to work effectively with Objective-C and Xcode. This book covers iOS 4 in a rigorous, orderly fashion—ideal whether youre approaching iOS for the first time or need a reference to bolster existing skills.
- Learn Objective-C language details and object-oriented programming concepts
- Understand the anatomy of an Xcode project and all the stages of its lifecycle
- Grasp key Cocoa concepts such as relationships between classes, receiving events, and model-view-controller architecture
- Know how views are managed, drawn, composited, and animated
- Delve into Cocoa frameworks for sound, video, sensors, maps, and more
- Touch on advanced topics such as threading and networking
- Obtain a thorough grounding for exploring advanced iOS features on your own
About the Author
Matt Neuburg started programming computers in 1968, when he was 14 years old, as a member of a literally underground high school club, which met once a week to do timesharing on a bank of PDP-10s by way of primitive teletype machines. He also occasionally used Princeton University's IBM-360/67, but gave it up in frustration when one day he dropped his punch cards. He majored in Greek at Swarthmore College, and received his Ph.D. from Cornell University in 1981, writing his doctoral dissertation (about Aeschylus) on a mainframe. He proceeded to teach Classical languages, literature, and culture at many well-known institutions of higher learning, most of which now disavow knowledge of his existence, and to publish numerous scholarly articles unlikely to interest anyone. Meanwhile he obtained an Apple IIc and became hopelessly hooked on computers again, migrating to a Macintosh in 1990. He wrote some educational and utility freeware, became an early regular contributor to the online journal TidBITS, and in 1995 left academe to edit MacTech Magazine. He is also the author of Frontier: The Definitive Guide and REALbasic: The Definitive Guide. In August 1996 he became a freelancer, which means he has been looking for work ever since. He is the author of Frontier: The Definitive Guide and REALbasic: The Definitive Guide, both for O'Reilly & Associates.
Table of Contents
Preface; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Notes on the Second Printing; Language; Chapter 1: Just Enough C; 1.1 Compilation, Statements, and Comments; 1.2 Variable Declaration, Initialization, and Data Types; 1.3 Structs; 1.4 Pointers; 1.5 Arrays; 1.6 Operators; 1.7 Flow Control and Conditions; 1.8 Functions; 1.9 Pointer Parameters and the Address Operator; 1.10 Files; 1.11 The Standard Library; 1.12 More Preprocessor Directives; 1.13 Data Type Qualifiers; Chapter 2: Object-Based Programming; 2.1 Objects; 2.2 Messages and Methods; 2.3 Classes and Instances; 2.4 Class Methods; 2.5 Instance Variables; 2.6 The Object-Based Philosophy; Chapter 3: Objective-C Objects and Messages; 3.1 An Instance Reference Is a Pointer; 3.2 Messages and Methods; 3.3 Typecasting and the id Type; 3.4 Messages as Data Type; 3.5 C Functions and Struct Pointers; 3.6 Blocks; Chapter 4: Objective-C Classes; 4.1 Class and Superclass; 4.2 Interface and Implementation; 4.3 Header File and Implementation File; 4.4 Class Methods; 4.5 The Secret Life of Classes; Chapter 5: Objective-C Instances; 5.1 How Instances Are Created; 5.2 Polymorphism; 5.3 The Keyword self; 5.4 The Keyword super; 5.5 Instance Variables and Accessors; 5.6 Key-Value Coding; 5.7 Properties; 5.8 How to Write an Initializer; IDE; Chapter 6: Anatomy of an Xcode Project; 6.1 New Project; 6.2 The Project Window; 6.3 The Project File and Its Dependents; 6.4 The Target; 6.5 From Project to App; Chapter 7: Nib Management; 7.1 A Tour of the Nib-Editing Interface; 7.2 Nib Loading and File's Owner; 7.3 Default Instances in the Main Nib File; 7.4 Making and Loading a Nib; 7.5 Outlet Connections; 7.6 Action Connections; 7.7 Additional Initialization of Nib-Based Instances; Chapter 8: Documentation; 8.1 The Documentation Window; 8.2 Class Documentation Pages; 8.3 Sample Code; 8.4 Other Resources; Chapter 9: Life Cycle of a Project; 9.1 Choosing a Device Architecture; 9.2 Localization; 9.3 Editing Your Code; 9.4 Navigating Your Code; 9.5 Debugging; 9.6 Static Analyzer; 9.7 Clean; 9.8 Running in the Simulator; 9.9 Running on a Device; 9.10 Device Management; 9.11 Version Control; 9.12 Instruments; 9.13 Distribution; 9.14 Ad Hoc Distribution; 9.15 Final App Preparations; 9.16 Submission to the App Store; Cocoa; Chapter 10: Cocoa Classes; 10.1 Subclassing; 10.2 Categories; 10.3 Protocols; 10.4 Optional Methods; 10.5 Some Foundation Classes; 10.6 The Secret Life of NSObject; Chapter 11: Cocoa Events; 11.1 Reasons for Events; 11.2 Subclassing; 11.3 Notifications; 11.4 Delegation; 11.5 Data Sources; 11.6 Actions; 11.7 The Responder Chain; 11.8 Application Lifetime Events; 11.9 Swamped by Events; Chapter 12: Accessors and Memory Management; 12.1 Accessors; 12.2 Key-Value Coding; 12.3 Memory Management; 12.4 Properties; Chapter 13: Data Communication; 13.1 Model-View-Controller; 13.2 Instance Visibility; 13.3 Notifications; 13.4 Key-Value Observing; Views; Chapter 14: Views; 14.1 The Window; 14.2 Subview and Superview; 14.3 Frame; 14.4 Bounds and Center; 14.5 Layout; 14.6 Transform; 14.7 Visibility and Opacity; Chapter 15: Drawing; 15.1 UIImage and UIImageView; 15.2 UIImage and Graphics Contexts; 15.3 CGImage; 15.4 Drawing a UIView; 15.5 Graphics Context State; 15.6 Paths; 15.7 Clipping; 15.8 Gradients; 15.9 Colors and Patterns; 15.10 Graphics Context Transforms; 15.11 Shadows; 15.12 Points and Pixels; 15.13 Content Mode; Chapter 16: Layers; 16.1 View and Layer; 16.2 Layers and Sublayers; 16.3 Drawing in a Layer; 16.4 Transforms; 16.5 Shadows, Borders, and More; 16.6 Layers and Key-Value Coding; Chapter 17: Animation; 17.1 Drawing, Animation, and Threading; 17.2 UIImageView Animation; 17.3 View Animation; 17.4 Implicit Layer Animation; 17.5 Core Animation; 17.6 Actions; Chapter 18: Touches; 18.1 Touch Events and Views; 18.2 Receiving Touches; 18.3 Restricting Touches; 18.4 Interpreting Touches; 18.5 Gesture Recognizers; 18.6 Touch Delivery; Interface; Chapter 19: View Controllers; 19.1 Creating a View Controller; 19.2 Rotation; 19.3 Modal Views; 19.4 Tab Bar Controllers; 19.5 Navigation Controllers; 19.6 View Controller Lifetime Events; 19.7 View Controller Memory Management; Chapter 20: Scroll Views; 20.1 Creating a Scroll View; 20.2 Scrolling; 20.3 Zooming; 20.4 Scroll View Delegate; 20.5 Scroll View Touches; 20.6 Scroll View Performance; Chapter 21: Table Views; 21.1 Table View Cells; 21.2 Table View Data; 21.3 Table View Selection; 21.4 Table View Scrolling and Layout; 21.5 Table View Searching; 21.6 Table View Editing; Chapter 22: Popovers and Split Views; 22.1 Presenting a Popover; 22.2 Managing a Popover; 22.3 Dismissing a Popover; 22.4 Automatic Popovers; 22.5 Split Views; Chapter 23: Text; 23.1 UILabel; 23.2 UITextField; 23.3 UITextView; 23.4 Core Text; Chapter 24: Web Views; 24.1 Loading Content; 24.2 Communicating with a Web View; Chapter 25: Controls and Other Views; 25.1 UIActivityIndicatorView; 25.2 UIProgressView; 25.3 UIPickerView; 25.4 UISearchBar; 25.5 UIControl; 25.6 Bars; Chapter 26: Modal Dialogs; 26.1 Alert View; 26.2 Action Sheet; 26.3 Dialog Alternatives; 26.4 Local Notifications; Some Frameworks; Chapter 27: Audio; 27.1 System Sounds; 27.2 Audio Session; 27.3 Audio Player; 27.4 Remote Control of Your Sound; 27.5 Playing Sound in the Background; 27.6 Further Topics in Sound; Chapter 28: Video; 28.1 MPMoviePlayerController; 28.2 MPMoviePlayerViewController; 28.3 UIVideoEditorController; 28.4 Further Topics in Video; Chapter 29: Music Library; 29.1 Exploring the Music Library; 29.2 The Music Player; 29.3 The Music Picker; Chapter 30: Photo Library; 30.1 UIImagePickerController; 30.2 The Assets Library Framework; Chapter 31: Address Book; 31.1 Address Book Database; 31.2 Address Book Interface; Chapter 32: Calendar; 32.1 Calendar Database; 32.2 Calendar Interface; Chapter 33: Mail; 33.1 Mail Message; 33.2 SMS Message; Chapter 34: Maps; 34.1 Presenting a Map; 34.2 Annotations; 34.3 Overlays; Chapter 35: Sensors; 35.1 Location; 35.2 Heading and Course; 35.3 Acceleration; Final Topics; Chapter 36: Persistent Storage; 36.1 The Sandbox; 36.2 Basic File Operations; 36.3 Saving and Reading Files; 36.4 User Defaults; 36.5 File Sharing; 36.6 Document Types; 36.7 Handing Off a Document; 36.8 XML; 36.9 SQLite; 36.10 Image File Formats; Chapter 37: Basic Networking; 37.1 HTTP Requests; 37.2 Bonjour; 37.3 Push Notifications; 37.4 Beyond Basic Networking; Chapter 38: Threads; 38.1 The Main Thread; 38.2 Why Threading Is Hard; 38.3 Three Ways of Threading; 38.4 Threads and App Backgrounding; Chapter 39: Undo; 39.1 The Undo Manager; 39.2 The Undo Interface; 39.3 The Undo Architecture; Chapter 40: Epilogue; Index; Colophon;