Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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.

eBook
zł39.99 zł158.99
Paperback
zł197.99
Subscription
Free Trial

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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

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.

Who is this book for?

If you've already explored iOS development and maybe even dabbled with Core Data, this book will set your data-driven application development on a firm footing.

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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 26, 2011
Length: 340 pages
Edition : 1st
Language : English
ISBN-13 : 9781849690959
Vendor :
Apple
Category :
Languages :
Tools :

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
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just zł20 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just zł20 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 617.97
iOS and OS X Network Programming Cookbook
zł221.99
iPhone User Interface Cookbook
zł197.99
Core Data iOS Essentials
zł197.99
Total 617.97 Stars icon
Banner background image

Table of Contents

11 Chapters
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

Customer reviews

Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.8
(4 Ratings)
5 star 0%
4 star 25%
3 star 25%
2 star 50%
1 star 0%
W Boudville Mar 14, 2012
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The English phrasings are awkward in various sections of the text. While the book describes its 2 inhouse reviewers, perhaps they ignored the grammatical aspects of the narrative. At the very least, a non-technical editor might have done a final run-through before it was sent to the printer.The book does not describe much about the graphical front end that you see in several screen captures. The code examples basically just give the minimal front end. Which is correct. Keep in mind that the focus is more on the backend, in a full Model-View-Controller pattern. The View part is the front end. Other books on iOS, like for gaming, emphasise those graphics.The text examples are extensive enough that you can understand the level of complexity likely needed in your applications. The 3 part nature of MVC necessitates this complexity, and it does mean that you might have to read more carefully to understand the logic than for a purely graphical application.As to how much detail the MVC deserved, this can be subjective. The amount of detail that the author furnished suffices to help a reader completely new to MVC, and indeed to the very idea of patterns. The book presents itself as covering the essentials; hence this, and it does seem an appropriate level of data and code snippets. Unfortunately, readers already versed in MVC on other platforms will just have to plough through what are to them extraneous details.
Amazon Verified review Amazon
mko Jun 08, 2011
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Whenever you start to develop an application it is just a matter of time when you decide that you need to save some data. No matter what will it be - settings for the application, list of the groceries in your TODO application, score achieved by the player during the game or some images. In that case, Code Data comes in handy. Core Data provides developer with an abstraction layer between GUI and datastore (whether it will be a flat file or SQLite database).Bintu Harwani tries to make this topic easier for the readers by providing the with the building process of the application that utilizes Core Data. At first, he goes over general, Core Data related, topics. He also presents target application that will be developed. Then, Objective-C content required for the application is explained - that is, protocols and Table View. After the indispensable introduction author jumps right into Core Data development.I, personally, prefer Cookbook like books, where certain topics are discussed without being bound to a particular topic too much. In this book different approach is presented. You are presented development process. In order to get as much as possible out of it you have to follow it from the start to the end. I think this approach is quite good for beginners where examples are more valuable than pure theory. In this terms I think that book might be useful for the beginners indeed. However, there are few drawbacks.First of all, book addresses iOS 3.0 while there is iOS 4.0 already heavily used and iOS 5.0 is already announced and ready for download for registered Apple iOS Developers. Basing on the XCode screen shoots I guess that XCode 3 was used instead of XCode 4. This may lead sometimes into confusion. You will see something different within book comparing to what you see on the screen. Another drawback is the way book is arranged. At least it is an issue for me. Within second chapter there is a section that describes applications behavior. This description goes over all the functionalities which is, for me, too detailed. I'd rather see just a brief description of application within section "Understanding Core Data" while at the same time I'd prefer to see details within chapters devoted to particular part of the application.I think that book can help readers to go through the basics of Core Data. I wouldn't recommend it for more advanced users that are looking for more sophisticated solutions within Core Data related area. But I think this is what title says. This book is about essentials, and in that case it is just fine.
Amazon Verified review Amazon
MyBrain Sep 22, 2012
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Das Hauptproblem des Buches liegt darin, dass von der Tabelle bis zur GUI alles haarklein vorgekaut wird und man das Hauptthema ständig verlässt. Dem Autor gelingt es nie, einen Überblick zu schaffen, so dass man irgendwann sich verfahren hat und man einige Seiten vorher neu starten muss.Essential ist hier mal gar nichts, krudes, einfaches Datenmodell ohne Sinn, das Thema Normalisierung wird einfach unterschlagen.Nochmals: Nur weil man etwas kann, ist man nicht gleich Didakt und kann sein Wissen vermitteln.
Amazon Verified review Amazon
Bertie Oct 02, 2011
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
I have been learning app development for a few months now with a background in procedural languages that I haven't touched for too many years. So I've been reading a LOT and using as many video tutorials as I can stand. I had started developing an app using SQLite but decided to investigate Core Data before I went any further. This was the book I chose because I wanted something that covered the basics with plenty of "hands on" exercises.Well... Let me start out by saying that I have not yet finished the book. I'm about half way through it. Let me also say that the book HAS helped me. I knew nothing and now I know something. So that can't be all bad.However...It's far from all good.A lot of the book deals with stuff that you really should know already. Adding classes, defining outlets, hooking things up in Interface Builder. Pages and pages of screenshots of IB that all do the same thing. It shouldn't be in this book. If you don't get the MVC concept already then you need to address that BEFORE you dig into Core Data NOT while you're learning it. It's as if the book was too small so they shoved in 50 or 60 pages of irrelevant screenshots and blurb about how to set up your viewControllers.The book has some questionable use of the English language. Nothing too dramatic but also nothing a decent Editor shouldn't have put right.But BY FAR the most annoying thing about the book is the code simply DOES NOT WORK properly. So I spend half and hour reading each of the last couple of chapters then a couple of hours re-reading the book, and re-reading my code to be sure it matches (which it does!) before going off to try and figure out what is wrong with it. So far successfully.Now I must say that I have come to xCode only in xCode4 which the book was obviously not written for. It could be that the code works perfectly well in xCode3 (but I doubt that because one of the errors appears to that a delegate is simply not declared a such in the examples). It's also possible that these are covered in the publishers website, but that doesn't excuse them being in the book in the first place.Also the layout chops and changes. Sometimes they put in a piece of code then put the title and explanation after it. Other times they put the title and explanation before the code excerpt. The second way works, the first way does not work and mixing the two is just... wrong, frankly.It feels a bit more like an instruction manual on "HOW to do things" rather than a learning aid telling you more about the "WHY you do things". There is a bit of "WHY" every so often and it can be quite good but it's all a bit shallow.It isn't the worst book I have read but it is far from the best. The extra time I have had to spend unraveling the bugs has maybe helped me as much as the actual content of the book. I might persevere with it but I find I approach each new chapter with the fear that it won't work and that I won't be able to figure out why.Bottom line: I can't recommend it. I'm running through the apple developer docs on the topic and they are clearer, better laid out, code works, covers at least as much ground and it's free (well it's free if you've paid the developer fees).This is just my experience with the text. I am pretty good at copying code from text and have been very thorough in reviewing each section and comparing my code to the text. It could be my mistakes that are causing my code not to work but having figured out the problem and then having re-reviewed the code in the book - I still can't see how it can work the way they have it.
Amazon Verified review Amazon
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.