INTRODUCTION

WITH THE INTRODUCTION OF THE IPHONE, Apple revolutionized the mobile computing market. The iPhone transformed the mobile phone from a device that you could use to make calls, check e-mail, and look up movie times into a computer that could run almost any type of application that you can think of. Since the iPhone's release in 2007, developers have written over 200,000 applications for the device. These "apps" encompass many categories including games, utilities, social networking, reference, navigation, and business among many others.

The trend in the field of computing is moving toward mobility and mobile platforms like the iPhone and away from a desktop-based environment. Particularly in business and corporate environments, decision makers want convenient access to their data at all times. The iPhone is an ideal platform for mobile computing because of its small form factor and extensive set of libraries and APIs, and its general popularity as a mobile phone.

While there are many terrific books on iPhone software development on the market, I couldn't find one geared toward the enterprise developer that needs to mobilize corporate data or business applications. My original goal for this book was to present these developers with the information that they would need to be able to get enterprise data from a back office server, display and manipulate that data on a mobile device, and then get the appropriate information back into their corporate information system.

As I worked through writing the book, it became clear that the tools and techniques that I cover in the book are applicable to many classes of applications in addition to the business use case that I had in mind when I started. Developers of any type of application that needs to store data on the iPhone will certainly be interested in the extensive coverage of the Core Data API. Any developer attempting to send data to an external web service such as Facebook or Twitter can benefit from the section of the book dealing with XML and web services. Many applications need to display data using tables, which I also cover in detail. Even though my original goal was to write a book for enterprise developers, I believe that I have written one that is useful when developing applications of just about any type.

WHO THIS BOOK IS FOR

As I mentioned, I started out writing this book for enterprise developers tasked with mobilizing corporate data and producing applications that could present and manipulate this data on a mobile device. During the process of writing the book, I became convinced that the tools, APIs and development techniques that I was covering were valuable for many categories of application development outside of the business realm. Anyone writing an application that deals with data in just about any way should find this book useful.

This should not be your first book on iPhone application development. You will not find a "Hello World" iPhone application here. There are many very good books on learning to build basic iPhone applications. I have aimed this book at developers that already understand how to build an iPhone application and how to design and build a user interface using Interface Builder, and who have a firm foundation in Objective-C. That is not to say that beginners will find nothing of use here, only that I write from a position that the reader already understands the basic architecture of iPhone applications and knows his or her way around the Xcode tools.

WHAT THIS BOOK COVERS

This book covers the technologies that you will need to understand in order to build data-centric applications for the iPhone and iPad. You will find a chapter on SQLite, the database engine that is included on every iPhone and iPad. Here, you will learn how to import data into the database from different file formats and how to query that data on the device. I cover the UITableView control extensively, including different strategies for customizing the display of your data. You will also find extensive coverage of the Core Data API. You will find yourself using this terrific data persistence framework often, as you need to create and store data on the device. Finally, I cover handling and creating XML on the iPhone and integrating your applications with web services.

HOW THIS BOOK IS STRUCTURED

I've structured the book in three parts that loosely correspond to the flow of data in an enterprise application. The first part of the book covers getting data out of a large-scale database such as Oracle, MySQL, or SQLServer; getting it on the device; and displaying it. The second part of the book covers creating data on the device and the Core Data API. The final part covers getting data out of the device and communicating with web services. Although I have tried to present the material in a logical order from chapter to chapter, there is no need to read the book in order. If you are building a TableView-based application and need to know how to customize the look and feel of your table, jump right into Chapter 3. If you are building an app for the iPad, look at Chapter 4. If you need to implement Core Data, jump right into Part II. If you need to integrate with a web service, check out Chapters 10 and 11.

WHAT YOU NEED TO USE THIS BOOK

Because I geared this book toward intermediate to advanced iOS developers, you should already have all of the tools that you need to use this book. You will need an Apple computer with Mac OS X to build applications for iOS. Additionally, you need to install the Xcode development environment that Apple graciously includes free with every installation of Mac OS X. If you do not have Xcode installed, and do not have your installation disk, you can download the latest version of Xcode from Apple's developer web site at http://developer.apple.com.

The only other requirement is that if you intend to install your applications on a physical device, as opposed to simply running your code in the iPhone simulator, you will need to join the iOS developer program. At the time of this writing, joining the program costs $99 annually and entitles you to build and run programs on your device and to submit your finished applications to the Apple App Store for sale. If you are not currently part of the developer program, don't worry. There is very little in the book that requires you to run on an actual device. Nearly everything will work correctly in the simulator. Where there is a need to run on the device, I have noted that in the text.

CONVENTIONS

To help you get the most from the text and keep track of what's happening, I've used a number of conventions throughout the book.

Warning

Boxes with a warning icon like this one hold important, not-to-be forgotten information that is directly relevant to the surrounding text.

Note

The pencil icon indicates notes, tips, hints, tricks, or asides to the current discussion.

As for styles in the text:

  • We highlight new terms and important words when we introduce them.

  • We show keyboard strokes like this: Ctrl+A.

  • We show file names, URLs, and code within the text like so: persistence.properties.

  • We present code in two different ways:

    We use a monofont type with no highlighting for most code examples.
    We use bold to emphasize code that's particularly important in the present
    context.

SOURCE CODE

As you work through the examples in this book, you may choose either to type in all the code manually or to use the source code files that accompany the book. All of the source code used in this book is available for download at www.wrox.com. You will find the code snippets from the source code are accompanied by a download icon and note indicating the name of the program so you know it's available for download and you can easily locate it in the download file. Once at the site, simply locate the book's title (either by using the Search box or by using one of the title lists) and click the Download Code link on the book's detail page to obtain all the source code for the book.

SOURCE CODE

Code snippets that are downloadable from wrox.com are easily identified with an icon; the file name of the code snippet follows in a code note that appears after the code, much like the one that follows this paragraph. If it is an entire code listing, the filename should appear in the listing title.

SOURCE CODE

Note

Because many books have similar titles, you may find it easiest to search by ISBN; this book's ISBN is 978-0-470-63617-6.

Once you download the code, just decompress it with your favorite compression tool. Alternately, you can go to the main Wrox code download page at www.wrox.com/dynamic/books/download.aspx to see the code available for this book and all other Wrox books.

ERRATA

We make every effort to ensure that there are no errors in the text or in the code. However, no one is perfect, and mistakes do occur. If you find an error in one of our books, like a spelling mistake or faulty piece of code, we would be very grateful for your feedback. By sending in errata you may save another reader hours of frustration and at the same time you will be helping us provide even higher quality information.

To find the errata page for this book, go to www.wrox.com and locate the title using the Search box or one of the title lists. Then, on the book details page, click the Book Errata link. On this page, you can view all errata that has been submitted for this book and posted by Wrox editors. A complete book list including links to each book's errata is also available at www.wrox.com/misc-pages/booklist.shtml.

If you don't spot "your" error on the Book Errata page, go to www.wrox.com/contact/techsupport.shtml and complete the form there to send us the error you have found. We'll check the information and, if appropriate, post a message to the book's errata page and fix the problem in subsequent editions of the book.

P2P.WROX.COM

For author and peer discussion, join the P2P forums at p2p.wrox.com. The forums are a Web-based system for you to post messages relating to Wrox books and related technologies and interact with other readers and technology users. The forums offer a subscription feature to e-mail you topics of interest of your choosing when new posts are made to the forums. Wrox authors, editors, other industry experts, and your fellow readers are present on these forums.

At http://p2p.wrox.com you will find a number of different forums that will help you not only as you read this book, but also as you develop your own applications. To join the forums, just follow these steps:

  1. Go to p2p.wrox.com and click the Register link.

  2. Read the terms of use and click Agree.

  3. Complete the required information to join as well as any optional information you wish to provide and click Submit.

  4. You will receive an e-mail with information describing how to verify your account and complete the joining process.

Note

You can read messages in the forums without joining P2P, but in order to post your own messages, you must join.

Once you join, you can post new messages and respond to messages other users post. You can read messages at any time on the Web. If you would like to have new messages from a particular forum e-mailed to you, click the Subscribe to this Forum icon by the forum name in the forum listing.

For more information about how to use the Wrox P2P, be sure to read the P2P FAQs for answers to questions about how the forum software works as well as many common questions specific to P2P and Wrox books. To read the FAQs, click the FAQ link on any P2P page.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset