Create bookmark
Head First iPhone Development
A Learner's Guide to Creating Objective-C Applications for the iPhone
Notes
Please login to add notes
-
+
Table of Contents
- 1. getting started: Going mobile
- 2. iPhone app patterns: Hello @twitter!
- 3. objective-c for the iPhone: Twitter needs variety
- 4. multiple views: A table with a view
- 5. plists and modal views: Refining your app
- 6. saving, editing, and sorting data: Everyone's an editor...
- 7. tab bars and core data: Enterprise apps
- 8. migrating and optimizing with core data: Things are changing
- 9. camera, map kit, and core location: Proof in the real world
- appendix i, leftovers: The top 6 things (we didn't cover)
- appendix ii, preparing your app for distribution: Get ready for the App Store
-
+
how to use this book: Intro
- + Who is this book for?
- We know what you’re thinking.
- And we know what your brain is thinking.
- Metacognition: thinking about thinking
- Here’s what WE did:
- Here’s what YOU can do to bend your brain into submission
- Read me
- System requirements
- The technical review team
- Acknowledgments
- Safari® Books Online
-
+
1. getting started: Going mobile
- There’s a lot of buzz and a lot of money tied up inthe App Store...
- + Mobile applications aren’t just ported desktop apps
- + Anatomy of an iPhone app
- Mike can’t make a decision
- Make a good first impression
- It all starts with the iPhone SDK
- Xcode includes app templates to help you get started
- Xcode is the hub of your iPhone project...
- Build your interface using... Interface Builder
- Add the button to your view
- The iPhone Simulator lets you test your app on your Mac
- + What happened?
- Use Interface Builder to connect UI controls to code
- Interface Builder lists which events a component can trigger
- Elements dispatch events when things happen to them
- Connect your events to methods
- iPhonecross
- iPhonecross Solution
- Your iPhone Toolbox
-
+
2. iPhone app patterns: Hello @twitter!
- First we need to figure out what Mike (really) wants
- + App design rules—the iPhone HIG
- HIG guidelines for pickers and buttons
- + Create a new View-based project for InstaTwit
- The life of a root view
- First, get the data from Mike
- + Use pickers when you want controlled input
- Fill the picker rows with Mike’s data
- + Pickers get their data from a datasource...
- + There’s a pattern for that
- Protocols tell you what methods (messages) you need to implement
- + First, declare that the controller conforms to both protocols
- The datasource protocol has two required methods
- Connect the datasource just like actions and outlets
- There’s just one method for the delegate protocol
- The button needs to be connected to an event
- Without an action, your button won’t work!
- Add the IBOutlet and property to our view controller
- Connect the picker to our outlet
- Use our picker reference to pull the selected values
- iPhonecross
- iPhonecross Solution
- Your iPhone Toolbox
-
+
3. objective-c for the iPhone: Twitter needs variety
- Renee is catching on....
- Make room for custom input
- Header files describe the interface to your class
- Auto-generated accessors also handle memory management
- Objective-C can automatically release references, too.
- To keep your memory straight, you need to remember just two things
- But when Mike’s finished typing...
- + Customize your UITextField
- + Components that use the keyboard ask it to appear...
- Ask the textField to give up focus
- Messages in Objective-C use named arguments
- Use message passing to tell our viewcontroller when the Done button is pressed
- Something’s still not right
- Build the tweet with strings
- Objective-Ccross
- Your Objective-C Toolbox
- Objective-Ccross Solution
-
+
4. multiple views: A table with a view
- So, how do these views fit together?
- The navigation template pulls multiple views together
- The navigation template starts with a table view
- A table is a collection of cells
- Each drink gets its own cell... sorta
- Just a few more drinks
- Plists are an easy way to save and load data
- Built-in types can save and load from plists automatically
- Arrays (and more) have built-in support for plists
- Use a detail view to drill down into data
- A closer look at the detail view
- Use the navigation controller to switch between views
- + Navigation controllers maintain a stack of views
- Instantiate a view controller like any other class
- Dictionaries store informationas key-value pairs
- + Debugging—the dark side of iPhone development
- First stop on your debugging adventure: the console
- + Interact with your application while it’s running
- Xcode supports you after your app breaks, too
- The Xcode debugger shows you the state of your application
- What the heck is going on?
- MultipleViewscross
- Your iPhone Toolbox
- MultipleViewscross Solution
-
+
5. plists and modal views: Refining your app
- It all started with Sam...
- Use the debugger to investigate the crash
- We’re trying to stuff a dictionary into a string
- Update your code to handle a plist of dictionaries
- The detail view needs data
- Each dictionary has all the information we need
- We have a usability problem
- Use a disclosure indicator if your cell leads to more information
- Sales were going strong...
- Use navigation controller buttons for editing
- The button should create a new view
- We need a view... but not necessarily a new view
- The view controller defines the behavior for the view
- + A nib file contains the UI components and connections...
- You can subclass and extend views like any other class
- Use Xcode to create a view controller without a nib
- + Modal views focus the user on the task at hand...
- Any view can present a modal view
- Our view doesn’t have a navigation bar
- Create the save and cancel buttons
- Write the save and cancel actions
- iPhoneDevcross
- Your iPhone Toolbox
- iPhoneDevcross Solution
-
+
6. saving, editing, and sorting data: Everyone’s an editor...
- Sam is ready to add a Red-Headed School Girl...
- ...but the keyboard is in the way
- We need to wrap our content in a scroll view
- The scroll view is the same size as the screen
- The keyboard changes the visible area
- iPhone notifies you about the keyboard
- + Register with the default notification center for events
- Keyboard events tell you the keyboard state and size
- The table view doesn’t know its data has changed
- You need to ask the table view to reload its data
- + The array is out of order, too
- Table views have built-in support for editing and deleting
- NavigationControllercross
- NavigationControllercross Solution
- Your iPhone Development Toolbox
-
+
7. tab bars and core data: Enterprise apps
- HF bounty hunting
- Choose a template to start iBountyHunter
- Drawing how iBountyHunter works...
- Build the fugitive list view
- Next up: the captured view
- After a quick meeting with Bob...
- + Core Data lets you focus on your app
- + Core Data needs to know what to load
- Core Data describes entities with a Managed Object Model
- Build your Fugitive entity
- Whip up a Fugitive class without writing a line
- + Our generated Fugitive class matches our Managed Object Model
- + Use an NSFetchRequest to describe your search
- + Add the database as a resource
- + The template sets things up for a SQLite DB
- + The iPhone’s application structure defines where you can read and write
- Copy the database to the correct place
- CoreDatacross
- Your Core Data Toolbox
- CoreDatacross Solution
-
+
8. migrating and optimizing with core data: Things are changing
- Bob needs documentation
- Everything stems from our object model
- + The data hasn’t been updated
- Data migration is a common problem
- + We need to migrate the old data into the new model
- Xcode makes it easy to version the data model
- Core Data can “lightly” migrate data
- Bob has some design input
- The Managed Object Context saves new or changed items
- A quick demo with Bob
- + Use predicates for filtering data
- We need to set a predicate on our NSFetchRequest
- + Core Data controller classes provide efficient results handling
- Time for some high-efficiency streamlining
- Refactor viewWillAppear to use the controller
- + We need to refresh the data
- DataMigrationcross
- DataMigrationcross Solution
- Your Data Toolbox
-
+
9: camera, map kit, and core location: Proof in the real world
- For Bob, payment requires proof!
- Flip over for the detail view!
- The way to the camera...
- The iPhone isn’t the only device using apps
- There’s a method for checking
- + Prompt the user with action sheets
- Bob needs the where, in addition to the when
- Core Location can find you in a few ways
- Core Location relies on the LocationManager
- + Add a new framework
- Just latitude and longitude won’t work for Bob
- Map Kit is new with iPhone 3.0
- A little custom setup for the map
- Annotations require a little more finesse
- AddingFunctionalitycross
- AddingFunctionalitycross Solution
- Your extras Toolbox
- It’s been great having you here!
-
+
i. leftovers: The top 6 things (we didn’t cover)
- + ii. preparing an app for distribution: Get ready for the App Store
- + Index
Let's say you have an idea for a killer iPhone app. Where do you begin? Head First iPhone Development will help you get your first application up and running in no time. You'll quickly learn to use iPhone SDK tools, including Interface Builder and Xcode, and master Objective-C programming principles that will make your app stand out. It's a complete learning experience for creating eye-catching, top-selling iPhone applications.
Put Objective-C core concepts to work, including message passing, protocols, properties, and memory management
Take advantage of iPhone patterns such as datasources and delegates
Preview your applications in the iPhone Simulator
Build complicated interactions that utilize multiple views, data entry/editing, and iPhone rotation
Work with iPhone's camera, GPS, and accelerometer
Optimize, test, and distribute your application
We think your time is too valuable to waste struggling with new concepts. Using the latest research in cognitive science and learning theory to craft a multi-sensory learning experience, Head First iPhone Development provides a visually-rich format designed for the way your brain works, not a text-heavy approach that puts you to sleep.
Test the closed alpha on paperc.com
Book Details
Authors
Dan Pilone Dan Pilone and Tracey Pilone Tracey Pilone
Categories
Computers > Hardware > Personal Computers > Macintosh
Publishers
Publication year : 2009
License: All rights reserved ©
Times read: 9,901

