1. Trang chủ
  2. » Công Nghệ Thông Tin

professional ios database application programming 2nd edition

388 914 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 388
Dung lượng 17,54 MB

Nội dung

www.it-ebooks.info ffirs.indd iffirs.indd i 4/1/2013 9:22:42 AM4/1/2013 9:22:42 AM www.it-ebooks.info PROFESSIONAL iOS Database Application Programming Second Edition Patrick Alessi ffirs.indd iffirs.indd i 4/1/2013 9:22:42 AM4/1/2013 9:22:42 AM www.it-ebooks.info Professional iOS Database Application Programming, Second Edition Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-39184-6 ISBN: 978-1-118-39185-3 (ebk) ISBN: 978-1-118-41757-7 (ebk) ISBN: 978-1-118-72836-9 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and speci cally disclaim all warranties, including without limitation warranties of  tness for a particular purpose. No warranty may be created or extended by sales or pro- motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the pub- lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with stan- dard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2013933611 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its af liates, in the United States and other coun- tries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book. ffirs.indd iiffirs.indd ii 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info For Cheryl—Without you, this would have never been possible. ffirs.indd iiiffirs.indd iii 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info ACQUISITIONS EDITOR Mary James PROJECT EDITOR Brian MacDonald TECHNICAL EDITOR Michael Gilbert PRODUCTION EDITOR Christine Mugnolo COPY EDITOR Karen A. Gill EDITORIAL MANAGER Mary Beth Wakefi eld FREELANCER EDITORIAL MANAGER Rosemarie Graham ASSOCIATE DIRECTOR OF MARKETING David Mayhew MARKETING MANAGER Ashley Zurcher BUSINESS MANAGER Amy Knies PRODUCTION MANAGER Tim Tate VICE PRESIDENT AND EXECUTIVE GROUP PUBLISHER Richard Swadley VICE PRESIDENT AND EXECUTIVE PUBLISHER Neil Edde ASSOCIATE PUBLISHER Jim Minatel PROJECT COORDINATOR, COVER Katie Crocker PROOFREADER Sarah Kaikini, Word One New York INDEXER Robert Swanson COVER DESIGNER Elizabeth Brooks COVER IMAGE © naphtalina / iStockphoto CREDITS ffirs.indd ivffirs.indd iv 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info ABOUT THE AUTHOR PATRICK ALESSI has been fascinated with writing computer programs since he  rst saw his name  ash across a terminal in 1980. Since then, he has written software using every language and hard- ware platform that he could get his hands on, including a brief and painful foray into Fortran on a VAX system during his engineering education. Patrick holds a BS degree in Civil Engineering from Rutgers University and an MS in Computer Science from Stevens Institute of Technology. Professionally, Patrick has focused on data-centric applications for clients ranging from small busi- ness databases to large-scale systems for the United States Air Force. Currently, he is focused on the promise of mobility and developing connected applications for mobile devices such as the iPhone and iPad. When he can back away from the computer, Patrick enjoys gaming (especially Starcraft), photog- raphy, traveling, and doing just about anything with his family. You can follow him on Twitter at pwalessi and read his blog at iphonedevsphere.blogspot.com. ABOUT THE TECHNICAL EDITOR MICHAEL GILBERT is a long-time systems programmer for various engineering  rms. He got his start developing games for the Atari ST, and he was a frequent contributing editor for STart magazine. Over the years, he has continued to develop gaming software on PC and Mac for clients worldwide. He’s also an expert Flash ActionScript programmer and has produced a popular Internet gaming environment called HigherGames. He now enjoys developing games for the iPhone and iPad, and currently has several games in the AppStore, with more on the way. In his spare time, he enjoys trying to defeat his wife Janeen in a friendly game of Scrabble. ffirs.indd vffirs.indd v 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info ffirs.indd viffirs.indd vi 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info ACKNOWLEDGMENTS I WOULD LIKE TO TAKE THIS OPPORTUNITY TO THANK everyone who made this book possible. Mary James, my acquisitions editor, shepherded this second edition through the acquisitions process. My project editor, Brian MacDonald, was there to answer every question that I had about writing and the publishing process. Mike Gilbert, my technical editor, gave up valuable app development time to review my work. I would also like to thank all the other editorial and production staff that put many hours into this project to help get it to print. I cannot thank my wife, Cheryl, and my stepdaughter, Morgan, enough for putting up with my  ts, general crankiness, and lack of time for fun family activities as I worked my way through writ- ing this book. Your patience with me is astounding. I want to thank my Mom for introducing me to computers at a very young age and teaching me the basics. Finally, I want to thank my Dad for pushing me to work hard and for showing me how to be a father. ffirs.indd viiffirs.indd vii 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info ffirs.indd viiiffirs.indd viii 4/1/2013 9:22:43 AM4/1/2013 9:22:43 AM www.it-ebooks.info [...]... 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 fi nd this book useful This should not be your fi rst book on iOS application development You will not fi nd a "Hello World" iOS application here There are many good books on learning to build basic iOS applications I have aimed this book... view-based application using Xcode that displays your data using the UITableView control You will also gain an understanding of the Model-View-Controller (MVC) architecture that underlies most iOS applications www.it-ebooks.info c01.indd 3 4/1/2013 2:38:26 PM 4 ❘ CHAPTER 1 INTRODUCING DATA-DRIVEN APPLICATIONS BUILDING A SIMPLE DATA-DRIVEN APPLICATION Many applications that you will build for iOS will... 22 The SQLite Library SQLite and Core Data 22 23 Building a Simple Database 24 Designing the Database Creating the Database Populating the Database Tools to Visualize the SQLite Database Connecting to Your Database Starting the Project The Model Class The DBAccess Class Parameterized Queries Writing to the Database Displaying the Catalog Viewing Product Details 25 27 29 33 36 36 39 40 49 50 51 53 Moving... the backbone of most applications It is not limited only to business applications Games, graphics editors, and spreadsheets all use and manipulate data in one form or another One of the most exciting things about iOS applications is that they enable you and your customers to take your data anywhere The mobility of iOS devices gives the developer an amazing platform for developing applications that work... in detail Finally, all iOS applications have a user interface, and I cover building user interfaces using storyboards Even though my original goal was to write a book for enterprise developers, I believe I have written one that is useful when developing applications of just about any type WHAT’S NEW IN THIS EDITION Since the fi rst edition of this book, much has changed in the iOS development community... types of applications that you can create for iOS and Mac OS X, as shown in Figure 1-1 FIGURE 1-1: New Project dialog Each option presented provides you with the basic setup needed to start developing your application The default iOS templates are divided into three groups: Application, Framework & Library, and Other www.it-ebooks.info c01.indd 4 4/1/2013 2:38:27 PM Building a Simple Data-Driven Application. .. graphics-intensive applications You will not be using OpenGL in this book ➤ Page-Based Application: This template provides a starting point for a page-based application that uses a page view controller You can use this template to build applications that incorporate page layout and page turning animations like iBooks ➤ Single View Application: This template provides a starting point for an application that... or nib file that contains the view The calculator application is an example of a single view application ➤ Tabbed Application: This template provides a starting point for an application that uses a tab bar It provides a user interface configured with a tab bar controller, and view controllers for the tab bar items The Clock application is a tabbed application The tabs at the bottom let you switch between... display data on iOS is the UITableView As the name suggests, the UITableView is a view that you can use to display data in a table You can see the UITableView in action in iOS s Contacts application The application displays your list of contacts in a UITableView control You learn much more about the UITableView control in Chapter 3 Typically, when developing the interface for your iOS applications, you... iPad CHAPTER 1: Introducing Data-Driven Applications CHAPTER 2: The iOS Database: SQLite CHAPTER 3: Displaying Your Data: The UITableView CHAPTER 4: User Interface Elements www.it-ebooks.info c01.indd 1 4/1/2013 2:38:24 PM www.it-ebooks.info c01.indd 2 4/1/2013 2:38:26 PM 1 Introducing Data-Driven Applications WHAT’S IN THIS CHAPTER? ➤ Creating a view-based application using Xcode ➤ Building a simple . AM www.it-ebooks.info PROFESSIONAL iOS Database Application Programming Second Edition Patrick Alessi ffirs.indd iffirs.indd i 4/1/2013 9:22:42 AM4/1/2013 9:22:42 AM www.it-ebooks.info Professional iOS Database Application. THE IOS DATABASE: SQLITE 21 What Is SQLite? 22 The SQLite Library 22 SQLite and Core Data 23 Building a Simple Database 24 Designing the Database 25 Creating the Database 27 Populating the Database. your  rst book on iOS application development. You will not  nd a "Hello World" iOS application here. There are many good books on learning to build basic iOS applications. I have

Ngày đăng: 05/05/2014, 16:28

TỪ KHÓA LIÊN QUAN