Professional iPhone and iPad Database Application Programming

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

A much-needed resource on database development and enterprise integration for the iPhone

An enormous demand exists for getting iPhone applications into the enterprise and this book guides you through all the necessary steps for integrating an iPhone app within an existing enterprise. Experienced iPhone developers will learn how to take advantage of the built-in capabilities of the iPhone to confidently implement a data-driven application for the iPhone.

Coverage includes:

  • Introducing Data-Driven Applications
  • The iPhone and iPad Database: Sqlite
  • Displaying Your Data: The UITableView
  • ipad Interface Elements
  • Introducing Core Data
  • Modeling Data in Xcode
  • Building a Core Data Application
  • Core Data-Related Cocoa Features
  • Core Data Migration and Performance
  • Working with Xml on the iPhone
  • Integrating with Web Services

Professional iPhone and iPad Database Application Programming gets you up to speed on developing data-driven applications for the iPhone.

 

 

 

 

Author(s): Patrick Alessi
Series: Wrox Professional Guides
Edition: 1
Publisher: Wrox
Year: 2010

Language: English
Pages: 387

WroxBooks......Page 2
Professional iPhone® and iPad™ Database Application Programming......Page 3
CONTENTS......Page 8
INTRODUCTION......Page 15
PART I: MANIPULATING AND DISPLAYING DATA ON THEIPHONE AND IPAD......Page 21
Building a Simple Data- Driven Application......Page 22
Creating the Project......Page 23
Model-View- Controller Architecture......Page 25
Adding the TableView Programmatically......Page 26
Retrieving Data......Page 27
Implementing Your Data Model Class......Page 28
Protocols......Page 31
Implementing the UITableViewDataSource Protocol......Page 32
Finishing Up......Page 34
Design Patterns......Page 36
Moving Forward......Page 37
CHAPTER 2: THE IPHONE AND IPAD DATABASE: SQLITE......Page 38
SQLite and Core Data......Page 39
Building a Simple Database......Page 40
Designing the Database......Page 41
Creating the Database......Page 43
Creating Records with the INSERT Command......Page 45
Reading Your Rows with the SELECT Command......Page 47
Tools to Visualize the SQLite Database......Page 50
Connecting to Your Database......Page 52
The UINavigationController......Page 53
The UITableViewController......Page 54
The Model Class......Page 55
The DBAccess Class......Page 56
Parameterized Queries......Page 66
Writing to the Database......Page 68
Displaying the Catalog......Page 69
Viewing Product Details......Page 71
Moving Forward......Page 74
Customizing the TableView......Page 76
TableViewCell Styles......Page 77
Adding Subviews to the contentView......Page 80
Subclassing UITableViewCell......Page 84
Getting Started......Page 85
Implementing drawRect:......Page 88
Finishing Up......Page 90
Implementing Sections and an Index......Page 91
Implementing Search......Page 97
Reusing Existing Cells......Page 104
Opaque Subviews......Page 105
Moving Forward......Page 107
Displaying Master/ Detail Data with the UISplitViewController......Page 108
Introducing the UISplitViewController......Page 109
The UISplitViewControllerDelegate Protocol......Page 111
Starting the Split View Sample Application......Page 112
Building the Detail Interface......Page 114
Setting Up the DetailViewController......Page 116
Changes to the RootViewController......Page 118
Modify the TableView Methods......Page 119
Adding Surveys......Page 120
Displaying Data in a Popover......Page 122
Building the InfoViewController......Page 123
Displaying the UIPopoverController......Page 126
The UIGestureRecognizer Class......Page 129
Using Gesture Recognizers......Page 130
Serializing the Survey Data Array......Page 134
Deserializing and Loading the Survey Data Array......Page 136
Sharing the Data......Page 137
Moving Forward......Page 138
PART II: MANAGING YOUR DATA WITH CORE DATA......Page 139
CHAPTER 5: INTRODUCING CORE DATA......Page 140
The Core Data Stack......Page 141
The Persistent Store Coordinator......Page 142
The Managed Object Context......Page 143
Creating the Project......Page 144
TasksAppDelegate......Page 145
The Data Model......Page 148
RootViewController......Page 149
Modifying the Template Code......Page 154
Moving Forward......Page 160
Modeling Your Data......Page 161
Defining Entities and Their Attributes......Page 162
Entity Details......Page 163
Adding Attributes......Page 165
Adding Relationships Between Entities......Page 166
Fetched Properties......Page 169
Creating Custom NSManagedObject Subclasses......Page 171
Implementing Validation Rules......Page 174
Creating the Tasks Model......Page 175
Moving Forward......Page 177
The Tasks Application Architecture......Page 178
The Class Model......Page 179
The User Interface......Page 180
RootViewController and the Basic UI......Page 182
Generating the Managed Object Subclasses......Page 186
Adding and Viewing Tasks......Page 187
Building the ViewTaskController......Page 188
Changes to the RootViewController......Page 193
Building the Editing Controllers......Page 195
Editing Text with the EditTextController......Page 196
Setting Priorities with the EditPriorityController......Page 200
Adding and Editing Locations with the EditLocationController......Page 204
Modifying Dates with the EditDateController......Page 210
Finishing Up the Editing Controllers......Page 214
Sorting Results with NSSortDescriptor......Page 218
Filtering Results with NSPredicate......Page 219
Generating Grouped Tables Using the NSFetchedResultsController......Page 220
Coding a Dynamic Property......Page 226
Defaulting Data at Runtime......Page 227
Validating a Single Field......Page 228
Multi-Field Validation......Page 230
Moving Forward......Page 232
CHAPTER 8: CORE DATA – RELATED COCOA FEATURES......Page 233
Keys and Keypaths......Page 234
Collection Operators......Page 235
Key-Value Observing......Page 236
Observing Changes to an Object......Page 237
Key-Value Observing Example......Page 238
Building the User Interface......Page 239
The Counter Data Object......Page 240
Implementing Key-Value Observing......Page 241
Updating Values with Key-Value Coding......Page 243
Creating Predicates......Page 245
Using Predicates......Page 246
Sort Descriptors......Page 247
Moving Forward......Page 248
Model Versioning and Schema Migration......Page 249
Model Versioning......Page 251
Lightweight Migration......Page 253
Generating a Mapping Model......Page 256
Designing for Threading......Page 260
Threading and Core Data......Page 261
Threading with NSOperation......Page 262
Core Data Threading Example......Page 263
Blocking the Main Thread......Page 265
Moving the Blocking Call......Page 266
Core Data Performance......Page 271
Faulting......Page 272
Storing Binary Data......Page 273
Runtime Performance......Page 274
Managing Changes with the Fetched Results Controller......Page 275
Starting Instruments......Page 278
The Instruments Interface......Page 280
The Core Data Instruments......Page 281
Moving Forward......Page 282
PART III: APPLICATION INTEGRATION USING WEB SERVICES......Page 283
iPhone SDK and the Web......Page 284
Web Application Architecture......Page 285
The URL Loading System......Page 286
Starting the Application......Page 288
Building the Interface......Page 289
Creating the Request......Page 290
NSURLConnection Delegate Methods......Page 291
Brief Overview of XML......Page 295
Parsing XML with NSXML Parser......Page 296
Starting Out......Page 298
Setting Up to Parse......Page 299
Implementing the Parser Delegate Methods......Page 301
Generating XML with libxml......Page 304
XML Generation Sample......Page 305
Moving Forward......Page 313
Network Application Architecture......Page 314
Two-Tier Architecture......Page 315
Three-Tier Architecture (n-tier)......Page 316
Introducing Web Services......Page 317
SOAP Messaging......Page 319
The REST Protocol......Page 320
Starting Out......Page 321
Core Location......Page 323
The Core Location Framework......Page 324
Using Core Location......Page 325
The Local Search API......Page 326
Using the Search Bar......Page 328
The NSURLConnection Delegate Methods......Page 331
Defining the Result Class......Page 333
Parsing the Response XML......Page 335
Using MapKit......Page 340
Finishing Up......Page 344
Getting Started......Page 345
Building the User Interface......Page 347
Implementing the POST Call......Page 348
Receiving the XML Response......Page 351
Parsing the Response XML......Page 353
Moving Forward......Page 355
Instruments......Page 356
Starting Instruments......Page 357
The Trace Document......Page 358
Objective-C Memory Management......Page 359
Sample Memory Leak Application......Page 361
Analyzing a Memory Leak in Instruments......Page 362
The Static Analyzer......Page 364
INDEX......Page 367