Product Details
The iPhone Developer's Cookbook: Building Applications with the iPhone SDK

The iPhone Developer's Cookbook: Building Applications with the iPhone SDK
By Erica Sadun

List Price: $39.99
Price: $26.39 & eligible for FREE Super Saver Shipping on orders over $25. Details

Availability: Usually ships in 24 hours
Ships from and sold by Amazon.com

61 new or used available from $18.89

Average customer review:

Product Description

“This book would be a bargain at ten times its price! If you are writing iPhone software, it will save you weeks of development time. Erica has included dozens of crisp and clear examples illustrating essential iPhone development techniques and many others that show special effects going way beyond Apple’s official documentation.”

—Tim Burks, iPhone Software Developer, TootSweet Software

 

“Erica Sadun’s technical expertise lives up to the Addison-Wesley name. The iPhone Developer’s Cookbook is a comprehensive walkthrough of iPhone development that will help anyone out, from beginners to more experienced developers. Code samples and screenshots help punctuate the numerous tips and tricks in this book.”

—Jacqui Cheng, Associate Editor, Ars Technica

 

“We make our living writing this stuff and yet I am humbled by Erica’s command of her subject matter and the way she presents the material: pleasantly informal, then very appropriately detailed technically. This is a going to be the Petzold book for iPhone developers.”

—Daniel Pasco, Lead Developer and CEO, Black Pixel Luminance

 

The iPhone Developer’s Cookbook: Building Applications with the iPhone SDK should be the first resource for the beginning iPhone programmer, and is the best supplemental material to Apple’s own documentation.”

—Alex C. Schaefer, Lead Programmer, ApolloIM, iPhone Application Development Specialist, MeLLmo, Inc

 

“Erica’s book is a truly great resource for Cocoa Touch developers. This book goes far beyond the documentation on Apple’s Web site, and she includes methods that give the developer a deeper understanding of the iPhone OS, by letting them glimpse at what’s going on behind the scenes on this incredible mobile platform.”

—John Zorko, Sr. Software Engineer, Mobile Devices

 

The iPhone and iPod touch aren’t just attracting millions of new users; their breakthrough development platform enables programmers to build tomorrow’s killer applications. If you’re getting started with iPhone programming, this book brings together tested, ready-to-use code for hundreds of the challenges you’re most likely to encounter. Use this fully documented, easy-to-customize code to get productive fast—and focus your time on the specifics of your application, not boilerplate tasks.

 

Leading iPhone developer Erica Sadun begins by exploring the iPhone delivery platform and SDK, helping you set up your development environment, and showing how iPhone applications are constructed. Next, she offers single-task recipes for the full spectrum of iPhone/iPod touch programming jobs:

  • Utilize views and tables
  • Organize interface elements
  • Alert and respond to users
  • Access the Address Book (people), Core Location (places), and Sensors (things)
  • Connect to the Internet and Web services
  • Display media content
  • Create secure Keychain entries
  • And much more

 

You’ll even discover how to use Cover Flow to create gorgeous visual selection experiences that put scrolling lists to shame!

 

This book is organized for fast access: related tasks are grouped together, and you can jump directly to the right solution, even if you don’t know which class or framework to use. All code is based on Apple’s publicly released iPhone SDK, not a beta. No matter what iPhone projects come your way, The iPhone Developer’s Cookbook will be your indispensable companion.

 


Product Details

  • Amazon Sales Rank: #98353 in Books
  • Published on: 2008-10-23
  • Original language: English
  • Number of items: 1
  • Binding: Paperback
  • 384 pages

Features


Editorial Reviews

Review

 

About the Author

Erica Sadun has written, coauthored, and contributed to about three dozen books about technology, particularly in the areas of programming, digital video, and digital photography. An unrepentant geek, Sadun has never met a gadget she didn’t need. Her checkered past includes run-ins with NeXT, Newton, iPhone, and myriad successful and unsuccessful technologies. When not writing, she and her geek husband parent three adorable geeks-in-training, who regard their parents with restrained bemusement.

Excerpt. © Reprinted by permission. All rights reserved.
Preface

Preface

Few platforms match the iPhone’s unique developer technologies. It combines OS X-based mobile computing with an innovative multitouch screen, location awareness, an onboard accelerometer, and more. When Apple introduced the iPhone Cocoa Touch SDK beta in early March 2008, developers responded in numbers that brought Apple’s servers to its knees. Apple delivered more than one hundred thousand SDK downloads in less than one week. The iPhone Developer’s Cookbook was written to address this demand, providing an accessible resource for those new to iPhone programming.

Who This Book Is For

This book is written for new iPhone developers with projects to get done and a new unfamiliar SDK in their hands. Although each programmer brings different goals and experiences to the table, most developers end up solving similar tasks in their development work: “How do I build a table?”; “How do I create a secure keychain entry?”; “How do I search the Address Book?”; “How do I move between views?”; and “How do I use Core Location?”

The iPhone Developer’s Cookbook is aimed squarely at anyone just getting started with iPhone programming. With its clear, fully documented examples, it will get you up to speed and working productively. It presents already tested ready-to-use solutions, letting programmers focus on the specifics of their application rather than on boilerplate tasks.

How This Book Is Structured

This book offers single-task recipes for the most common issues new iPhone developers face: laying out interface elements, responding to users, accessing local data sources, and connecting to the Internet. The cookbook approach delivers cut-and-paste convenience. Programmers can add source recipes into their projects and then customize them to their needs. Each chapter groups related tasks together. Readers can jump directly to the kind of solution they’re looking for without having to decide which class or framework best matches that problem.

Here’s a rundown of what you’ll find in this book’s chapters:

  • Chapter 1: Getting Started with the iPhone SDK

    Chapter 1 introduces the iPhone SDK and explores the iPhone as a delivery platform, limitations and all. It explains the breakdown of the standard iPhone application and enables you to build your first Hello World style samples.

  • Chapter 2: Views

    Chapter 2 introduces iPhone views, objects that live on your screen. You see how to lay out, create, and order your views to create backbones for your iPhone applications. You read about view hierarchies, geometries, and animations as well as how users can interact with views through touch.

  • Chapter 3: View Controllers

    The iPhone paradigm in a nutshell is this: small screen, big virtual worlds. In Chapter 3, you discover the various UIViewController classes that enable you to enlarge and order the virtual spaces your users interact with. You learn how to let these powerful objects perform all the heavy lifting when navigating between iPhone application screens.

  • Chapter 4: Alerting Users

    The iPhone offers many ways to provide users with a heads up, from pop-up dialogs and progress bars to audio pings and status bar updates. Chapter 4 shows how to build these indications into your applications and expand your user-alert vocabulary.

  • Chapter 5: Basic Tables

    Tables provide an interaction class that works particularly well on a small, cramped device. Many, if not most, apps that ship with the iPhone and iPod touch center on tables, including Settings, YouTube, Stocks, and Weather. Chapter 5 shows how iPhone tables work, what kinds of tables are available to you as a developer, and how you can use table features in your own programs.

  • Chapter 6: Advanced Tables

    iPhone tables do not begin and end with simple scrolling lists. You can build tables with titled sections, with multiple scrolling columns, and more. You can add controls such as switches, create translucent cell backgrounds, and include custom fonts. Chapter 6 starts from where “Basic Tables” left off. It introduces advanced table recipes for you to use in your iPhone programs.

  • Chapter 7: Media

    As you’d expect, the iPhone can load and display media from a wide variety of formats. It does music; it does movies. It handles images and Web pages. You can present PDF documents and photo albums and more. Chapter 7 shows way after way that you can import or download data into your program and display that data using the iPhone’s multitouch interface.

  • Chapter 8: Control

    The UIControl class provides the basis for many iPhones interactive elements, including buttons, text fields, sliders, and switches. Chapter 8 introduces controls and their use, both through well-documented SDK calls and through less-­documented ones.

  • Chapter 9: People, Places, and Things

    In addition to standard user interface controls and media components that you’d see on any computer, the iPhone SDK provides a number of tightly focused developer solutions specific to iPhone and iPod touch delivery. Chapter 9 introduces the most useful of these, including Address Book access (“people”), core location (“places”), and sensors (“things”).

  • Chapter 10: Connecting to Services

    As an Internet-connected device, the iPhone is particularly suited to subscribing to Web-based services. Apple has lavished the platform with a solid grounding in all kinds of network computing services and their supporting technologies. The iPhone SDK handles sockets, password keychains, SQL access, XML processing, and more. Chapter 10 surveys common techniques for network computing and offering recipes that simplify day-to-day tasks.

  • Chapter 11: One More Thing: Programming Cover Flow

    Although Cover Flow is not officially included in the iPhone SDK, it offers one of the nicest and most beautiful features of the iPhone experience. With Cover Flow, you can offer your users a gorgeously intense visual selection experience that puts standard scrolling lists to shame. Chapter 11 introduces Cover Flow and shows how you can use it in your applications.

Prerequisites

Here are basics you need on hand to begin programming for the iPhone or iPod touch:

  • A copy of Apple’s iPhone SDK. Download your copy of the iPhone SDK from Apple’s iPhone Dev Center (http://developer.apple.com/iphone/). You must join Apple’s (free) developer program before you download.
  • An iPhone or iPod touch. Although Apple supplies a simulator as part of its SDK, you really do need to have an actual unit to test on if you’re going to develop any serious software. You’ll be able to use the cable that shipped with your iPhone or iPod touch to tether your unit to the computer and install the software you’ve built.
  • An Apple iPhone Developer License. You will not be able to test your software on an actual iPhone or iPod touch until you join Apple’s iPhone Developer program (http://developer.apple.com/iphone/program). Members receive a certificate that allows them to sign their applications and download them to the platforms in question for testing and debugging. The program costs $99/year for individuals and companies, $299/year for in-house enterprise development.
  • An Intel-based Macintosh running Leopard. The SDK requires a Macintosh running Leopard OS X 10.5.3 or later. Apple requires an Intel-based computer in 32-bit mode. Many features do not work properly on PPC-based Macs or Intel Macs in 64-bit mode. Reserve plenty of disk space and at least 1GB of RAM.
  • At least one available USB 2.0 port. This enables you to tether your development iPhone or iPod touch to your computer for file transfer and testing.
  • An Internet connection. This connection enables you to test your programs with a live WiFi connection as well as with EDGE.
  • Familiarity with Objective-C. The SDK is built around Objective-C 2.0. The language is based on standard C with object-oriented extensions. If you have any object-oriented and C background, making the move to Objective-C is both quick and simple. Consult any Objective-C/Cocoa reference book to get up to speed.

Note - Although the SDK supports development for the iPhone and iPod touch, as well as possible yet-to-be-announced platforms, this book refers to the target platform as iPhone for the sake of simplicity. When developing for the touch, most material is applicable. This excludes certain obvious features such as telephony and onboard speakers. This book attempts to note such exceptions in the manuscript.


Contacting the Author

If you have any comments or questions about this book, please drop me an e-mail ­message at erica@ericasadun.com or stop by http://www.ericasadun.com. My Web site hosts many of the applications discussed in this book. Please feel free to visit, download ­software, read documentation, and leave your comments.


© ...


Customer Reviews

New to Apple's Developer Tools? This book is not for you!2
The book states it is aimed "squarely at anyone just getting started with iPhone programming." It is not.

At the time of purchase, I was a brand new iPhone developer with zero exposure to Apple's developer tools and their iPhone SDK. That said, I am a very seasoned Java and C# developer, I have used Eclipse and VS.NET extensively for numerous years to build some very sophisticated applications. Apple's developer tools, XCode and Interface Builder, are radically different tools unlike either of these development environments. Instead of a singular IDE, the Apple tools are a hodgepodge of separate applications filling your screen with a plethora of small tool and inspector windows. If you are brand new to XCode and Interface Builder, this book simply doesn't have enough horse power to properly educate you on the pitfalls newbies will face.

If you are already familiar with Apple's developer tools, then the book may be better received by you then by someone who had no exposure to them.

As a newbie you need to realize a very, very important point: copying code out of a book and into XCode is simply not enough to get a demo working out of this or any iPhone developer book! The trick is knowing how to "link" within Interface Builder- how to establish what I now know to be IBAction and IBOutlet property decorators. The IB stands for "Interface Builder" and these two markers provide "hints" from XCode to Interface Builder. For example, to "link" a button from Interface Builder to a property in XCode, the @property would have to be properly decorated (with IBOutlet) and then you must physically establish the link in Interface Builder, using a control-click-drag metaphor from source to destination. To my point- therein lies the problem with "recipe" books like this one- unless you already have a grasp on this concept and how it works (which I didn't when I bought the book several weeks ago), this book will leave you very frustrated. You have verbatim code in XCode, but things don't work! Worse, you have no idea why. [bang head on desk repeatedly here]

My recommendation is to look at the forthcoming book from the guys over at Pragmatic Programmer- iPhone SDK Development I purchased their book, and while it still left me to figure out some holes and some of the Interface Builder nuances, it was much more targeted for someone who has never used any of Apple's developer tools. The Pragmatic book isn't a panacea for all newbie problems, but it is far better suited then this "recipe" book.

I'm confident (well, hoping) that as my iPhone developer experiences grow and I become more accustomed to Apple's developer tools, the recipes presented in this book might be of more value.

It is my opinion that its stated objective should have read "...squarely at anyone just getting started with iPhone programming who is already comfortable with the nuances of XCode, Interface Builder, and the other Apple developer tools."

Not For Beginners3
The "Who This Book Is For" section of this book states: "This book is written for new iPhone developers with projects to get done and a new unfamiliar SDK in their hands." I am rating this book three stars because it does not live up to this statement.

As someone familiar enough with Xcode and iPhone development to understand the Apple templates and Cocoa design patterns, I was sadly disappointed when I discovered that the code listings in this book were not separated into .m and .h files. Rather, all code is jumbled up into long single-file, multipage listings. The author even states that this format is suited for book publishing. I whole-heartedly feel that this single issue makes this book worthless to a new iPhone developer. Why? A newly created default iPhone project in Xcode has separate .h and .m files.

In addition to the above-mentioned flaw, this book does little beyond Chapter one to hand-hold a new iPhone developer. This book in not instructional at all in this regard and is only suited for those with several months or more of Xcode/iPhone SDK experience. That said, Chapter one contains incredibly detailed and well thought out introductory material, enough so that it may mislead you into thinking this book is for beginners. Chapter two jumps right into code without even explaining the bare essentials of Obj-C.

Furthermore, I think the lack of IB (Interface Builder) instruction will only confuse matters more. I equate this to coding in VB without The Visual Studio IDE.

It is clear, however, that Ms. Sadun knows what she is talking about when it comes to iPhone development. I give her credit for that. Unfortunately, her book comes off no clearer than Apple's own documentation.

I recommend you look elsewhere if you are starting out as a brand-new iPhone developer.

Good and Bad3
I've been working through this book since it came out and had to write a review. I'll be short.

Pro's: This is one of the first, and for awhile only books on the iPhone SDK available. It is written in a friendly manner, and if you understand Xcode and Object Oriented Programming, you'll do OK.It does cover things more clearly than many of the code SDK snippet sites, and is often better organized.

Con's: Boy, this thing was PUSHED out the door. There are many errors in the book that you'll be able to fix yourself. Novices beware of keying in the examples. It may not be your typing that's causing the error. The level of detail in the book jumps from highly precise to woefully lacking. Often on the same page. Many concepts and terms are used without any attempt to explain them.

Make sure you download the code samples from the author web site (ericasadun.com) they have been updated, commented, and actually compile. However, they often mix bad practices, like not breaking out headers, or naming things clearly, in with the code.

At this point in time (2008), this is a very valuable book, because there are so few good references out there. The second edition needs to be much more solid, or it will quickly be eclipsed by other books coming onto the market.