Home Page Icon
Home Page
Table of Contents for
About the Technical Reviewer
Close
About the Technical Reviewer
by Jeff LaMarche, Dave Mark
More iPhone 3 Development: Tackling iPhone SDK 3
Copyright
About the Authors
About the Technical Reviewer
Acknowledgments
Preface
1. Here We Go Round Again
1.1. What This Book Is
1.2. What You Need to Know
1.3. What You Need Before You Can Begin
1.4. What's In this Book
1.5. Are You Ready?
I. Core Data
2. The Anatomy of Core Data
2.1. A Brief History of Core Data
2.2. Creating a Core Data Template Application
2.3. Core Data Concepts and Terminology
2.4. The Data Model and Persistent Store
2.4.1. The Data Model Class: NSManagedObjectModel
2.4.2. The Persistent Store and the Persistent Store Coordinator
2.4.3. Reviewing the Data Model
2.5. Entities and the Data Model Editor
2.5.1. Entities
2.5.2. Properties
2.5.2.1. Attributes
2.5.2.2. Relationships
2.5.2.3. Fetched Properties
2.5.2.4. Fetch Requests
2.6. Managed Objects
2.6.1. Key-Value Coding
2.6.2. Managed Object Context
2.6.3. Saves on Terminate
2.7. Loading Data from the Persistent Store
2.8. The Fetched Results Controller
2.8.1. Creating a Fetched Results Controller
2.8.2. The Fetched Results Controller Delegate Methods
2.8.2.1. Will Change Content Delegate Method
2.8.2.2. Did Change Content Delegate Method
2.8.2.3. Did Change Object Delegate Method
2.8.2.4. Did Change Section Delegate Method
2.8.3. Retrieving a Managed Object from the Fetched Results Controller
2.8.4. Creating and Inserting a New Managed Object
2.8.5. Deleting Managed Objects
2.9. Putting Everything in Context
3. A Super Start: Adding, Displaying, and Deleting Data
3.1. Setting up the Xcode Project
3.1.1. Application Architecture
3.1.2. Modifying the Application Delegate Interface
3.1.3. Adding to the Application Delegate Implementation
3.2. Creating the Table View Controller
3.3. Setting up MainWindow.xib
3.3.1. Connecting the Outlets
3.4. Designing the Data Model
3.4.1. Adding an Entity
3.4.2. Editing the New Entity
3.4.3. Adding Attributes to the New Entity
3.4.4. Adding the Name Attribute
3.4.5. Editing the Attribute
3.4.5.1. Attribute Types
3.4.5.2. The Integer Datatypes
3.4.5.2.1. The Decimal, Double, and Float Datatypes
3.4.5.2.2. The String Datatype
3.4.5.2.3. The Boolean Datatype
3.4.5.2.4. The Date Datatype
3.4.5.2.5. The Binary Datatype
3.4.5.2.6. The Transformable Datatype
3.4.5.3. Setting the Name Attributes's Type
3.4.5.4. Adding the Rest of the Attributes
3.5. Creating HeroListViewController
3.5.1. Declaring the Fetched Results Controller
3.5.2. Drag Two Icons to Your Project
3.5.3. Designing the HeroListViewController Interface
3.5.4. Implementing the Hero View Controller
3.6. Let 'Er Rip
3.7. Done, but Not Done
4. The Devil in the Detail View
4.1. Table-Based vs. Nib-Based Detail Views
4.2. Detail Editing View Challenges
4.3. Controlling Table Structure with Arrays
4.4. Paired Arrays
4.4.1. Nested Arrays
4.4.2. Paired Nested Arrays
4.4.3. Representing Our Table Structure with Arrays
4.4.4. Nested Arrays, Categorically Speaking
4.4.5. Updating the SuperDB Project
4.5. Formatting of Attributes
4.6. Creating the Detail View Controller
4.6.1. Declaring Instance Variables and Properties
4.6.2. Implementing the Viewing Functionality
4.6.3. Using the New Controller
4.6.3.1. Declaring the Outlet
4.6.3.2. Adding the Instance to MainWindow.xib
4.6.3.3. Pushing the New Instance onto the Stack
4.6.4. Trying Out the View Functionality
4.7. Adding Editing Subcontrollers
4.7.1. Creating the Superclass
4.7.2. Creating the String Attribute Editor
4.7.3. Creating the Date Attribute Editor
4.7.4. Using the Attribute Editors
4.8. Implementing a Selection List
4.8.1. Creating the Generic Selection List Controller
4.9. Devil's End
5. Preparing for Change: Migrations and Versioning
5.1. About Data Models
5.1.1. Data Models Are Compiled
5.1.2. Data Models Can Have Multiple Versions
5.1.2.1. Creating a New Data Model Version
5.1.2.2. The Current Data Model Version
5.1.3. Data Model Version Identifiers
5.1.4. Using the Versioned Data Model
5.2. Migrations
5.2.1. Lightweight vs. Standard
5.2.2. Standard Migrations
5.2.3. Setting up Your App to Use Lightweight Migrations
5.3. Time to Migrate On
6. Custom Managed Objects
6.1. Updating the Data Model
6.1.1. Adding the Age Attribute
6.1.2. Adding the Favorite Color Attribute
6.1.3. Adding a Minimum Length to the Name Attribute
6.2. Creating the Hero Class
6.3. Tweaking the Hero Header
6.4. Defaulting
6.5. Validation
6.5.1. Single-Attribute Validations
6.5.2. Multiple-Attribute Validations
6.6. Virtual Accessors
6.7. Adding Validation Feedback
6.7.1. Updating the ManagedObjectAttributeEditor Header File
6.7.2. Updating the ManagedObjectAttributeEditor Implementation File
6.7.3. Updating the Subclasses to Use Validation
6.7.3.1. Updating ManagedObjectStringEditor
6.7.3.2. Updating ManagedObjectDateEditor
6.7.3.3. Updating ManagedObjectSingleSelectionListEditor
6.8. Creating the Value Transformer
6.9. Creating the Color Attribute Editor
6.10. Displaying the New Attributes in Hero Edit Controller
6.11. The Display Problem
6.12. Adding View-Only Support to Hero Edit Controller
6.12.1. Hiding the Disclosure Indicator
6.12.2. Handling Taps on Read-Only Attributes
6.13. Color Us Gone
7. Relationships, Fetched Properties, and Expressions
7.1. Expanding Our Application: Superpowers and Reports
7.2. Relationships
7.2.1. To-One Relationships
7.2.2. To-Many Relationships
7.2.3. Inverse Relationships
7.2.4. Delete Rules
7.3. Fetched Properties
7.4. Creating Relationships and Fetched Properties in the Data Model Editor
7.4.1. Adding the Power Entity
7.4.2. Creating the Powers Relationship
7.4.3. Creating the Inverse Relationship
7.4.4. Creating the olderHeroes Fetched Property
7.4.5. Creating the youngerHeroes Fetched Property
7.4.6. Creating the sameSexHeroes Fetched Property
7.4.7. Creating the oppositeSexHeroes Fetched Property
7.5. Adding Relationships and Fetched Properties to the Hero Class
7.6. The Big Refactor
7.6.1. Renaming the Class
7.6.2. Refactoring the hero Instance Variable
7.6.3. Removing the Arrays
7.6.4. Supporting Save and Cancel Buttons
7.6.4.1. Adding the isNew Method to NSManagedObject
7.6.4.2. Adding the Save and Cancel Buttons
7.6.5. Adding Support for To-Many Relationships
7.6.5.1. Turning on Edit Mode
7.6.5.2. Setting Row Indentation
7.6.5.3. Setting the Correct Number of Rows for To-Many Sections
7.6.5.4. The Set Problem
7.6.5.5. Specifying the Editing Style for the Rows
7.6.5.6. Displaying To-Many Sections
7.6.5.7. Updating Row Selection for To-Many Relationships
7.6.5.8. Handling To-Many Inserts and Deletes
7.7. Using the New Generic Controller
7.7.1. Adding Factory Methods for Hero and Power
7.7.2. Deleting the Nib Instance
7.7.3. Updating HeroListController
7.8. Creating the Fetched Property Attribute Controller
7.9. Cleaning Up Deleted Objects
7.10. Wonderful to the Core
II. Further Explorations
8. Peer-to-Peer Over Bluetooth Using GameKit
8.1. This Chapter's Application
8.2. Network Communication Models
8.2.1. Client-Server Model
8.2.2. Peer-to-Peer Model
8.2.3. Hybrid Client-Server/Peer-to-Peer
8.3. The GameKit Session
8.3.1. Creating the Session
8.3.2. Finding and Connecting to Other Sessions
8.3.3. Listening for Other Sessions
8.3.4. Sending Data to a Peer
8.3.5. Packaging Up Information to Send
8.3.6. Receiving Data from a Peer
8.3.7. Closing Connections
8.4. The Peer Picker
8.4.1. Creating the Peer Picker
8.4.2. Handling a Peer Connection
8.4.3. Creating the Session
8.5. Creating the Project
8.5.1. Turning Off the Idle Timer
8.5.2. Importing the GameKit Framework
8.5.3. Designing the Interface
8.5.3.1. Setting Up the View Controller Header
8.5.3.2. Designing the Game Board
8.5.3.3. Creating the TicTacToePacket Object
8.5.3.4. Implementing the Tic-Tac-Toe View Controller
8.6. Trying It Out
8.7. Game On!
9. Online Play: Bonjour and Network Streams
9.1. This Chapter's Application
9.2. Overview of the Process
9.3. Setting Up a Listener
9.3.1. Callback Functions and Run Loop Integration
9.3.2. Configuring a Socket
9.3.2.1. Declaring a Socket Context
9.3.2.2. Creating a Socket
9.3.3. Specifying a Port for Listening
9.3.4. Registering the Socket with the Run Loop
9.3.5. Implementing the Socket Callback Function
9.3.6. Stopping the Listener
9.4. Bonjour
9.4.1. Creating a Service for Publication
9.4.1.1. Publishing a Bonjour Service
9.4.1.2. Stopping a Bonjour Service
9.4.1.3. Delegate Methods for Publication
9.4.2. Searching for Published Bonjour Services
9.4.3. Browser Delegate Methods
9.4.4. Resolving a Discovered Service
9.5. Streams
9.5.1. Opening a Stream
9.5.2. The Stream and Its Delegate
9.5.3. Receiving Data from a Stream
9.5.4. Sending Data Through the Stream
9.6. Putting It All Together
9.7. Updating Tic-Tac-Toe for Online Play
9.7.1. Adding the Packet Categories
9.7.2. Implementing the Online Session Object
9.7.3. Creating the Listener Object
9.7.4. Creating the Peer Browser
9.7.4.1. Creating the Peer Browser Files
9.7.4.2. Writing the Peer Browser Header
9.7.4.3. Building the Peer Browser Interface
9.7.4.4. Implementing the Peer Browser View Controller
9.7.5. Updating TicTacToeViewController to Support Online Play
9.8. Time to Play
10. Working with Data from the Web
10.1. Setting Up the Application Skeleton
10.1.1. Declaring Actions and Outlets
10.1.2. Designing the Interface
10.1.3. Implementing the Stubs
10.2. Retrieving Data Using Foundation Objects
10.3. Retrieving Data Synchronously
10.3.1. The URL Request
10.4. Retrieving Data Asynchronously
10.4.1. NSURLConnection Delegate Methods
10.4.2. Adding Asynchronous Retrieval to WebWorks
10.5. Request Types and Form Parameters
10.5.1. Specifying the HTTP Request Types
10.5.2. Form Parameters
10.5.2.1. GET Parameters
10.5.2.2. POST Parameters
10.5.3. Building the RequestTypes Application
10.6. 404 Conclusion Not Found
11. MapKit
11.1. This Chapter's Application
11.2. Overview and Terminology
11.3. The Map View
11.3.1. Map Types
11.3.2. User Location
11.3.3. Coordinate Regions
11.3.3.1. Converting Degrees to Distance
11.3.3.2. Accommodating Aspect Ratio
11.3.4. Setting the Region to Display
11.3.5. The Map View Delegate
11.3.5.1. Map Loading Delegate Methods
11.3.5.2. Region Change Delegate Methods
11.4. Annotations
11.4.1. The Annotation Object
11.4.2. The Annotation View
11.4.3. Adding and Removing Annotations
11.4.4. Selecting Annotations
11.4.5. Providing the Map View with Annotation Views
11.5. Reverse Geocoding
11.6. Building the MapMe Application
11.6.1. Declaring Outlets and Actions
11.6.2. Building the Interface
11.6.3. Writing the Annotation Object Class
11.6.4. Implementing MapMeViewController
11.6.5. Linking the Map Kit and Core Location Frameworks
11.7. Go East, Young Programmer
12. Sending Mail
12.1. This Chapter's Application
12.2. The MessageUI Framework
12.2.1. Creating the Mail Compose View Controller
12.2.2. Prepopulating the Subject Line
12.2.3. Prepopulating Recipients
12.2.4. Setting the Message Body
12.2.5. Adding Attachments
12.2.6. Presenting the Mail Compose View
12.2.7. The Mail Compose View Controller Delegate Method
12.3. Building the MailPic Application
12.3.1. Declaring Outlets and Actions
12.3.2. Building the User Interface
12.3.3. Implementing the View Controller
12.3.4. Linking the MessageUI Framework
12.4. Mailing It In...
13. iPod Library Access
13.1. This Chapter's Application
13.2. Working with the iPod Library
13.2.1. Media Items
13.2.1.1. Media Item Persistent ID
13.2.1.2. Media Type
13.2.1.3. Filterable String Properties
13.2.1.4. Nonfilterable Numeric Attributes
13.2.1.5. Retrieving Lyrics
13.2.1.6. Retrieving Album Artwork
13.2.1.7. Retrieving the Date Last Played
13.2.2. Media Item Collections
13.2.2.1. Creating a New Collection
13.2.2.2. Retrieving Media Items
13.2.2.3. Creating Derived Collections
13.2.3. Media Queries and Media Property Predicates
13.2.4. The Media Picker Controller
13.2.4.1. Handling Media Picker Cancels
13.2.4.2. Handling Media Picker Selections
13.2.5. The Music Player Controller
13.2.5.1. Creating the Music Player Controller
13.2.5.2. Determining If the Music Player Controller Is Playing
13.2.5.3. Specifying the Music Player Controller's Queue
13.2.5.4. Getting or Setting the Currently Playing Media Item
13.2.5.5. Skipping Tracks
13.2.5.6. Seeking
13.2.5.7. Playback Time
13.2.5.8. Repeat and Shuffle Modes
13.2.5.9. Adjusting the Music Player Controller's Volume
13.2.5.10. Music Player Controller Notifications
13.3. Building the Simple Player Application
13.3.1. Adding Media Item Collection Functionality
13.3.2. Declaring Outlets and Actions
13.3.3. Building the User Interface
13.3.4. Implementing the Simple Player View Controller
13.3.5. Taking Simple Player for a Spin
13.4. Avast! Rough Waters Ahead!
14. Keeping Your Interface Responsive
14.1. Exploring the Concurrency Problem
14.2. Creating the Stalled Application
14.2.1. Declaring Actions and Outlets
14.2.2. Designing the Interface
14.2.3. Implementing the Stalled View Controller
14.3. Timers
14.3.1. Creating a Timer
14.3.2. Stopping a Timer
14.3.3. Limitations of Timers
14.4. Fixing Stalled with a Timer
14.4.1. Creating the Batch Object
14.4.2. Updating the Controller Header
14.4.3. Updating the Nib
14.4.4. Updating the View Controller Implementation
14.5. Operation Queues & Concurrency
14.5.1. Threads
14.5.1.1. Race Conditions
14.5.1.2. Mutex Locks and @synchronized
14.5.1.3. Atomicity and Thread Safety
14.5.1.4. Deadlocks
14.5.1.5. Sleepy Time
14.5.2. Operations
14.5.2.1. Operation Dependencies
14.5.2.2. Operation Priority
14.5.2.3. Other Operation State
14.5.2.4. Cancelling an Operation
14.5.3. Operation Queues
14.5.3.1. Adding Operations to the Queue
14.5.3.2. Setting the Maximum Concurrent Operation Count
14.5.3.3. Suspending the Queue
14.6. Fixing Stalled with an Operation Queue
14.6.1. Creating SquareRootApplication
14.6.2. Changes to StalledViewController.h
14.6.3. Adjusting the User Interface
14.7. Updating StalledViewController.m
14.8. Queue 'em Up
15. Debugging
15.1. The Debugger
15.1.1. Breakpoints
15.1.1.1. The Debugger Editing Pane
15.1.1.2. The Stack Trace
15.1.1.3. The Variable List
15.1.1.4. The Debugging Controls
15.1.1.5. Trying Out the Debug Controls
15.1.1.6. The Breakpoint Window and Symbolic Breakpoints
15.1.1.7. Conditional Breakpoints
15.1.1.8. Breakpoint Actions
15.1.2. The GDB Console
15.1.2.1. The Info Command
15.1.2.2. Working with Breakpoints
15.1.2.2.1. Creating Breakpoints
15.1.2.2.2. Removing Breakpoints
15.1.2.3. Printing Data and Object Values
15.1.2.4. Calling Functions and Methods
15.2. Static Analysis
15.3. Specific Bugs
15.3.1. Overreleasing Memory
15.3.1.1. NSZombie
15.3.2. Infinite Recursion
15.3.3. Missed Outlet and Action Connections
15.4. GDB: Stopped at Concluding Paragraph
16. The Road Goes Ever On...
16.1. Getting Unstuck
16.1.1. Apple's Documentation
16.1.2. Mailing Lists
16.1.3. Discussion Forums
16.1.4. Web Sites
16.1.5. Blogs
16.1.6. And If All Else Fails...
16.2. Farewell
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
About the Authors
Next
Next Chapter
Acknowledgments
About the Technical Reviewer
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset