You are previewing Head First iPhone and iPad Development, 3rd Edition.
O'Reilly logo
Head First iPhone and iPad Development, 3rd Edition

Book Description

Have a killer app idea for iPhone and iPad? Head First iPhone and iPad Development will help you get your first application up and running in no time. You'll not only learn how to design for Apple's devices, you'll also master the iPhone SDK tools -- including Xcode -- and Objective-C programming principles to create eye-catching, top-selling apps.

Table of Contents

  1. Dedication
  2. Special Upgrade Offer
  3. Advance Praise for <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="emphasis"><em>Head First iPhone and iPad Development</em></span>
  4. Praise for other <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="emphasis"><em>Head First</em></span> books books
  5. Praise for other <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="emphasis"><em>Head First</em></span> books books
  6.  
  7. Authors of Head First iPhone and iPad Development
  8. Coauthors of Head First iPhone and iPad Development
  9. How to use this book: Intro
    1. Who is this book for?
      1. Who should probably back away from this book?
    2. We know what you’re thinking
    3. We know what your brain is thinking
    4. Metacognition: thinking about thinking
    5. Here’s what WE did:
    6. Here’s what YOU can do to bend your brain into submission
    7. Read Me
    8. System requirements
    9. The technical review team
  10. Acknowledgments
    1. Safari Books Online
  11. 1. Getting Started: Getting mobile with iOS
    1. So you want to build an iOS app...
    2. Welcome to the Apple universe!
    3. iOS apps are written in Objective-C
    4. It all starts with the SDK
    5. Pin Xcode...you’re going to be here a lot
    6. Meet Sue, your new boss
    7. Xcode and Git...new best friends
    8. Xcode is the hub of your iOS project
    9. The iOS simulator
    10. Your code is stored in source files
    11. Code Editor, Hub...and debugging, too
    12. One iPhone, two iPhones, red iPhone, blue iPhone...
    13. Your iPhone Development toolbox
  12. 2. Basic iOS Patterns: Building from scratch
    1. iOS apps run full screen, but there’s a lot going on
    2. Model-View-Controller is a design pattern
    3. Get started with Xcode and Git
    4. Design time!
    5. Design time...redux
    6. Cosmetic changes are easy in Xcode
    7. You could code this if you’re into that kind of thing...
    8. iOS controls are more than skin deep
      1. The code your button calls is an Action
    9. You’ll create the action using the Xcode GUI editor
    10. Connect your controls to your actions
      1. This is your control
      2. This is your controller...
      3. Your control has events...
      4. ...and those events can connect to Actions
      5. So about these classes and interfaces we keep writing...
    11. So how do we get to that text?
    12. Properties handle creating getters and setters
    13. Create a property for that text field
    14. You connect your controls to outlets
      1. An IBOutlet references something in the UI
    15. Twitter, the easy way...
    16. Your iOS Basics toolbox
  13. 3. Interlude: Syntax
    1. Classes: Interface and Implementation
    2. Header files describe the interface to your class
    3. Properties are about efficiency
      1. Property attributes talk to the compiler
    4. Message passing: How Objective-C gets around
    5. Speaking of messages....
    6. Your Syntax toolbox
  14. 4. Tables, Views, and Data: A table with a view
    1. Congratulations!
    2. SpinCity browsing app overview
    3. The way iOS apps work
    4. Using the touch screen....
    5. Hierarchical data—get out your table view
      1. Use table and detail views together to represent hierarchical data
    6. We need to hook these views together...
      1. The navigation controller gets you around in your views
    7. Three views in one template
    8. Use MVC to separate your concerns...
    9. Adding a new class
    10. Properties expose class attributes
    11. Data Access Objects hide low-level data access
    12. You’ve built your DAO!
    13. A table is a collection of cells
      1. Storyboards can layout custom table view cells too
    14. Your View toolbox
  15. 5. Multiview Applications: It’s all about the details
    1. An app with a view...
      1. Detail views are everywhere
    2. Table views don’t always look like...tables
    3. Change your UIViewController to a UITableView Controller
    4. Layout for the new detail view
    5. Layout your view within the storyboard
    6. Design the rest of the view <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">dynamically</span>
    7. Segues connect view controllers
    8. Connect your scenes in your storyboard
    9. Segues let you prepare for a new scene
    10. Update your prepareforSegue callback
    11. There’s <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="strikethrough">an app</span> a list for that a list for that
    12. Create a new property list
    13. You need to load each album from the plist
    14. Convert your data to plists in one easy step
    15. Your View toolbox
  16. 6. The Review Process, Design, and Devices: How to live with Apple
    1. It’s <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">Apple&#8217;</span>s world...you&#8217;re just living in its world...you’re just living in it
    2. Device checking... it’s not optional
    3. Device checking case study: the camera
    4. iOS handles the heavy lifting
    5. Hmmm... supported device, missing feature
    6. The HIG <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">helps</span>, rather than , rather than <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">hurting</span> you you
    7. You’ve <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">already</span> gotten used to the HIG... gotten used to the HIG...
    8. Design = look + feel
    9. iOS 7 Top 5
    10. More to think about: your iPad is <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">not</span> your iPhone your iPhone
    11. Your Apple toolbox
  17. 7. Basic Core Data and Table View Cells: Reruns are hard to find
    1. This is your application
    2. This is your application on data
    3. Introducing Core Data
      1. But wait, there’s more!
    4. ...and speaking of data
    5. The Gilligizer app
    6. Core Data starts with...data
    7. Core Data works with entities
      1. We need to define the entity for Core Data
    8. Core Data describes entities with a Managed Object Model
    9. Build your Show entity
    10. Our generated Show class matches our Managed Object Model
    11. NSManagedObject also implements the properties
    12. You have an <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">object</span>...now ...now <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">present</span> it. it.
    13. Present each entity in Gilligizer
    14. Your Core Data toolbox
  18. 8. Implementing search with core data: Looking for info
    1. The app is working, but it’s limited...
    2. Use an NSFetchRequest to describe your search
    3. Let’s give it a shot...
    4. iOS 7 has Core Data and UIKit support for searching
    5. SearchDisplayController handles just about everything
    6. Use predicates for filtering data
      1. NSFetchRequest concepts are nearly identical to SQL
    7. The NSFetchRequest predicate controls what data is returned
      1. The Search Bar lets you know what’s happening through a delegate
    8. It was a trick question...
    9. Your searching toolbox
  19. 9. Core data, mapkit, and core location: Finding a phone booth
    1. Everything old is cool <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="gray-background">new</span> again again
    2. An app, an iPad, and a phone booth
    3. iOS apps are <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">read-only</span> (well, kind of...) (well, kind of...)
    4. An iOS application structure defines where you can read and write data
      1. Get the photo path and then write that path to the filesystem!
    5. Enter... UIImagePicker
    6. Prompt the user with <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">action sheets</span>
      1. Action sheets lead to...dactions!
    7. Where <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="strikethrough">Who</span>... are you? Where ... are you? Where <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="strikethrough">Who, who</span>??
    8. Core Location can find you in a <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">few</span> ways ways
      1. Core Location relies on the <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="underline">LocationManager</span>
    9. Map Kit comes with every iOS device
    10. Annotations require a little more <span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:pls="http://www.w3.org/2005/01/pronunciation-lexicon" xmlns:ssml="http://www.w3.org/2001/10/synthesis" xmlns:svg="http://www.w3.org/2000/svg" class="strikethrough">work</span> finesse finesse
    11. Fully implement the annotation protocol
    12. Your kit Toolbox
  20. Index
  21. About the Authors
  22. Special Upgrade Offer
  23. Copyright