| Title Page | 1 |
|---|
| Copyright Page | 2 |
|---|
| Contents at a Glance | 4 |
|---|
| Table of Contents | 5 |
|---|
| Preface | 10 |
|---|
| Acknowlegments | 11 |
|---|
| Introduction | 12 |
|---|
| Who This Book Is For | 12 |
| What s in the Book | 13 |
| Danton Chin | 14 |
|---|
| Chapter 1 Using Concurrency to Improve the Responsiveness of iPhoneand iPad Applications | 16 |
| Prepare for Concurrency | 16 |
| Non-Responsive User Interfaces | 19 |
| Building the Interestingness User Interface | 20 |
| Adding A JSON Parsing Framework to the InterestingnessApp | 23 |
| Composing a RESTful Request for a List of Interestingness Images | 23 |
| Using the RESTful Request and the JSON Parser to Parse the Response | 25 |
| Implementing the UITableViewDataSource Protocol Methods to Display the Results | 27 |
| Concurrency Landscape | 29 |
| Considerations When Using Concurrent Solutions | 30 |
| Concurrency with NSThread and NSObject | 32 |
| Concurrency with Operation Objects | 37 |
| NSOperationQueue | 38 |
| NSOperation and NSInvocationOperation | 39 |
| NSInvocationOperation Quick and Easy | 40 |
| Subclassing NSOperation | 40 |
| Building HelloOperationQueues a Toy Application | 41 |
| Building the User Interface for HelloOperationQueues | 43 |
| Creating Work Units by Subclassing NSOperation | 45 |
| Implementing HelloOperationQueues | 46 |
| Changing the Interestingness App to Use NSOperationQueues | 50 |
| Implementing the NSInvocationOperation to Fetch the List of interestingness images | 52 |
| Implementing FetchImageOperation a Subclass of NSOperation | 53 |
| Implementing the getImageForURL: and storeImageForURL:Methods | 55 |
| Concurrency with Operation Objects and Blocks | 58 |
| Blocks | 59 |
| Adding the PLBlocks Framework | 61 |
| Changing the Interestingness Application to Use NSOperationQueues and Blocks | 63 |
| Converting the Interestingness App to Use an Official Version of Blocks and NSBlockOperation from Apple | 66 |
| Summary | 66 |
| Resources | 67 |
| Apple and Apple-related News | 67 |
| Apple Documentation | 67 |
| Blocks and Grand Central Dispatch | 68 |
| General | 69 |
| JSON | 69 |
| POSIX Threads | 69 |
| Claus Höfele | 70 |
|---|
| Chapter 2 Your Own Content Pipeline: Importing 3D Art Assets into Your iPhoneGame | 72 |
| Starting an iPhone Game | 72 |
| Why Write Your Own Tools? | 73 |
| Creating a Flexible Content Pipeline | 74 |
| The Tools Problem | 74 |
| Data Exchange vs. In-Game File Formats | 76 |
| Outline of the Example Code | 77 |
| Exporting 3D Models | 78 |
| Reading FBX files | 79 |
| Traversing the Scene Contents | 82 |
| Distinguishing between Different Types of Scene Nodes | 83 |
| OpenGL Triangle Data | 84 |
| Converting FBX Models into Triangle Data | 86 |
| Converting Triangle Data into an In-Game Format | 89 |
| Handling Textures | 92 |
| Image Compression vs. Texture Compression | 92 |
| Imagination s PVRTC Format | 93 |
| Reading PNG Images | 95 |
| Converting Images into the PVRTC Format | 97 |
| Rendering the Converted Data on the iPhone | 99 |
| Running the Converter Tool | 99 |
| Creating the iPhone Project | 99 |
| Summary | 100 |
| Ben Kazez | 102 |
|---|
| Chapter 3 How Flight Track Uses External Data Providers to Power This Best-SellingTravel App | 104 |
| Choosing a Data Source | 105 |
| API Design | 106 |
| Data Coverage and Accuracy | 107 |
| Economics | 108 |
| Attribution | 108 |
| Subscription | 108 |
| Transactional | 108 |
| Revenue Share | 109 |
| Trials | 109 |
| Source-Driven User Interface Design | 109 |
| Challenges | 110 |
| Techniques from FlightTrack | 111 |
| Design Patterns for Data Source Consumption | 112 |
| Direct-Client Consumption | 112 |
| Server-Intermediary Consumption | 113 |
| Data-Driven Cocoa App Architecture | 114 |
| Data Model Design | 114 |
| Connecting Data to UI | 115 |
| Delegates | 115 |
| Notifications | 116 |
| Setter Propagation | 117 |
| Choosing an Approach | 117 |
| Release! | 118 |
| FlightTrack Today | 118 |
| Saul Mora | 120 |
|---|
| Chapter 4 Write Better Code and Save Time with Unit Testing | 122 |
| Mock Objects | 133 |
| Testing Your Core Data Models | 140 |
| Summary | 147 |
| Leon Palm | 148 |
|---|
| Chapter 5 Fun with Computer Vision:Face Recognition with OpenCV on the iPhone | 150 |
| What Is Computer Vision? | 153 |
| Why Do Computer Vision on an iPhone? | 154 |
| Your Project: Creating a Face Detector | 155 |
| Setting Up OpenCV | 155 |
| Setting Up XCode | 158 |
| Adding Image Conversion Functions | 160 |
| Creating a Simple GUI | 162 |
| Loading Images from the Photo Library | 164 |
| Loading the Haar
|