Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Core Data iOS Essentials
Core Data iOS Essentials

Core Data iOS Essentials: Knowing Core Data gives you the option of creating data-driven iOS apps, and this book is the perfect way to learn as it takes you through the process of creating an actual app with hands-on instructions.

€28.99 €19.99
Book Apr 2011 340 pages 1st Edition
eBook
€28.99 €19.99
Print
€37.99
Subscription
€14.99 Monthly
eBook
€28.99 €19.99
Print
€37.99
Subscription
€14.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Apr 26, 2011
Length 340 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781849690942
Vendor :
Apple
Category :
Table of content icon View table of contents Preview book icon Preview Book

Core Data iOS Essentials

Chapter 1. Overview

This book is a practical guide to help you in developing Data-Driven iPhone applications using Core Data. The tremendous success of iPhone has increased the demand of mobile applications. Besides the Game-based applications, there is a huge market for the data-driven mobile applications too. The focus of this book is to make you understand how the Core Data, Apple's persistence framework, is used for developing data-driven mobile applications.

Prerequisite


This book assumes that you have a basic understanding of the iPhone SDK and you also know the basics of iPhone SDK programming.

To better understand the concept of Core Data, you should:

  • Have a good understanding of the Objective-C protocol and the delegation pattern

  • Be familiar with data source patterns, such as UITableView and UITableViewDataSource, for the purpose of displaying information

Even if you're not aware of these two concepts, Chapter 3, Understanding Objective-C Protocol and Table View and Chapter 4, Designing a Data Model and Building Data Objects for Customers of the book are focused to get you acquainted with them. That is why the two chapters are self-contained and each chapter presents an individual application.

A brief history


The iPhone as we all know is an integrated cellular telephone and media player developed and marketed by Apple. It has become very popular in the past few years because of its amazing features. Looking at its huge number of users, developers around the world are attracted to develop applications for this unique device. Developers realized that besides games, there is a huge market of data applications for iPhone device. The attraction of creating data applications for iPhone device resulted into development of the Core Data framework. But the question is where did Core Data come from?

Core Data was first developed at NeXT Computer as the DBKit framework in 1992, which then became the Enterprise Object Framework (EOF) in 1994.

Enterprise Object Framework (EOF)

EOF is an object-relational mapping (ORM) framework that provides a mechanism for accessing the data as an object-oriented class structure. It is well-designed and encourages Model View Controller (MVC) design patterns. It also simplifies the tedious job of creating an application's data model. EOF is not just a framework, it is also a tool that helps in creating the application's data model visually — the task that was previously done by creating Objective-C classes. Besides this, the framework handles all the work involved in persisting the data to a SQL database, flat file, or any other data store. Based on object-oriented architecture, EOF is very flexible to use too. The roots of the Core Data framework come from the Enterprise Objects Framework (EOF).

Core Data

Core Data is part of the Cocoa API in Mac OS X first introduced with Mac OS X 10.4 Tiger and for the iOS with iPhone SDK 3.0. It is a powerful data model framework that was specifically designed to provide local data storage for Cocoa applications. The modeling functionality of Core Data is integrated right into XCode, so there's no need to switch back and forth between the IDE and modeler. With interface builder, it allows developers to quickly create a user interface (known as the views of the application in MVC terminology) without writing a single line of code. It is also the most effective solution to data persistence and allows us to persist our data to any number of different storage mediums, which includes storing data as XML, in binary files, or in an embedded SQLite database. The data modeling tool of Xcode allows us to define our application's data model graphically, which can be easily accessed through code. Instances of the entities defined in the data model are then managed by the Core Data framework and stored to a storage medium such as an XML file or SQLite database.

Now the question arises, what is Xcode and why we are using it for developing Core Data applications?

Why use Xcode?

Xcode is Apple's most comprehensive Software Development Kit (SDK), and it provides an environment for developing the applications for iPhone. It is a highly customizable integrated development environment (IDE) that includes compilers and applications, together with an extensive set of programming libraries and interfaces. It is a powerful source editor and a graphic debugger too. While developing applications with XCode, it gives us an option to enable a checkbox for enabling Core Data support. On selecting the checkbox, Xcode automatically creates code for us that make the task of developing core data applications quite easy.

Source code


The source code of the book is available at the URL specified in the Preface of the book.

You'll find chapter-wise code bundle in the ZIP file. The book is so organized that it guides you to develop a data-drive application step-by-step. That is, by the end of the book, you'll be having a complete data-driven running application with you. In case, you want to run the end product directly, follow the below given steps:

  1. 1. Unzip the source bundle of the last chapter, Chapter 11, Displaying the Products for Sale and Updating the Stock on your local Mac.

  2. 2. Open Xcode, go to File | Open from the menu, and browse to the unzipped bundle of Chapter 11, Displaying the Products for Sale and Updating the Stock. In the prob folder, select the prob.xcodeproj file followed by clicking on the Open button.

  3. 3. Select the Build and Run icon from the Xcode project window to run the application. You'll get the main view of the application as shown in the following image. But the application is not yet ready to run until we define the photos of the master products (products that we are going to sell through application).

  4. 4. To define photos of the master products in iPhone Simulator, go to Home and then click on the Photos icon (refer to the given image (a)).

  5. 5. We get the Albums page as shown in image (b). Because we have not created any photo album yet, the figure displays the message, No Photos.

  6. 6. Drag the first image, IMG_0000.JPG provided in the code bundle of Chapter 11, Displaying the Products for Sale and Updating the Stock onto the simulator screen. Tap on the image and hold down the mouse on the image until the popover comes up, as shown in image (c). Click on the Save Image button to save the image.

  7. 7. Repeat the procedure for the other three images (IMG_0001.JPG, IMG_0002.JPG, IMG_0003.JPG). After saving the four images, the simulator will display the images as shown in image (a).

  8. 8. On clicking back to Photos, we find that an album Saved Photos appears with one of the images considered as the icon of the photo album (image (b)). The number (4) in parenthesis represents that there are four images in this photo album.

  9. 9. Now, our application is completely ready for execution. For any guidance regarding operating the application, refer to the An application output sample section in Chapter 2, Understanding Core Data.

Shall we begin?


After following how our book will proceed, let us now get ready to dive in. Get ready for the introduction of Core Data and the step-by-step journey to understand its different concepts and applying them practically in developing a data-driven mobile application.

Left arrow icon Right arrow icon

Key benefits

  • Covers the essential skills you need for working with Core Data in your applications.
  • Particularly focused on developing fast, light weight data-driven iOS applications.
  • Builds a complete example application. Every technique is shown in context.
  • Completely practical with clear, step-by-step instructions.

Description

Core Data is the essential ingredient in data driven iOS apps. It's used for storing, retrieving, and manipulating application data in databases, XML, and binary formats. It's an essential component for iPhone, iPod Touch, and iPad apps.Core Data Essentials provides a clear, readable guide to the most useful aspects of Core Data. Built around a realistic example app, the book showcases the most important aspects of Core Data development in the context of a complete, functioning app written in Objective C.The book starts with a tour of how the app works. Then you'll see how to easily display data using the Table View. You'll learn how to develop an appropriate data model that fits the needs of your app, then implement that model as updatable data objects. You'll see how to update data and build relationships between objects and learn how Core Data can work with search, and how to provide your users with friendly data editing features.

What you will learn

Get a solid grasp of what Core Data is and how it works Build full featured data driven applications for iOS devices Design appropriate data models to fit your app s needs Make your app s data easily searchable Display your data in an attractive, flexible way

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Apr 26, 2011
Length 340 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781849690942
Vendor :
Apple
Category :

Table of Contents

19 Chapters
Core Data iOS Essentials Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
Acknowledgement Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Overview Chevron down icon Chevron up icon
Understanding Core Data Chevron down icon Chevron up icon
Understanding Objective-C Protocol and Table View Chevron down icon Chevron up icon
Designing a Data Model and Building Data Objects for Customers Chevron down icon Chevron up icon
Creating, Listing, and Deleting Names of Customers Chevron down icon Chevron up icon
Creating, Listing, Displaying, and Deleting Records of Customers Chevron down icon Chevron up icon
Updating and Searching Records of Customers Chevron down icon Chevron up icon
Entering, Saving, Listing, and Deleting the Records of the Products Sold to the Customers Chevron down icon Chevron up icon
Entering, Displaying, and Deleting the Stock Chevron down icon Chevron up icon
Editing the Stock Information Chevron down icon Chevron up icon
Displaying the Products for Sale and Updating the Stock Chevron down icon Chevron up icon
Appendix Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.