Core Data iOS Essentials


Core Data iOS Essentials
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$22.94
save 15%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$44.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Reviews
Support
Sample Chapters
  • 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.

Book Details

Language : English
Paperback : 340 pages [ 235mm x 191mm ]
Release Date : April 2011
ISBN : 1849690944
ISBN 13 : 9781849690942
Author(s) : B.M.Harwani
Topics and Technologies : All Books, Mobile Application Development, iOS, Mobile

Table of Contents

Preface
Chapter 1: Overview
Chapter 2: Understanding Core Data
Chapter 3: Understanding Objective-C Protocol and Table View
Chapter 4: Designing a Data Model and Building Data Objects for Customers
Chapter 5: Creating, Listing, and Deleting Names of Customers
Chapter 6: Creating, Listing, Displaying, and Deleting Records of Customers
Chapter 7: Updating and Searching Records of Customers
Chapter 8: Entering, Saving, Listing, and Deleting the Records of the Products Sold to the Customers
Chapter 9: Entering, Displaying, and Deleting the Stock
Chapter 10: Editing the Stock Information
Chapter 11: Displaying the Products for Sale and Updating the Stock
Appendix: Appendix
Index
  • Chapter 1: Overview
    • Prerequisite
    • A brief history
      • Enterprise Object Framework (EOF)
      • Core Data
      • Why use Xcode?
    • Source code
    • Shall we begin?
    • Chapter 2: Understanding Core Data
      • Core Data
        • Core Data features
      • Data Model
        • Entities
        • Properties
        • Attributes
        • Relationships
          • Inverse relationship
      • Model View Controller (MVC)
      • Core Data API
        • Persistent Store
        • Persistent Store Coordinator
        • FetchRequest
        • FetchedResultsController
      • Overview of the application: Sales Record System for a Departmental Store
      • Entity Relationship Diagram
      • An application output sample
        • Entering Master Product Information
        • Modifying the Master Product
        • Deleting the Master Product
        • Entering customer information and order details
        • Deleting customer information
        • Searching for specific customers
        • Searching and modifying customer information
        • Entering Customer Sales Information
      • Automatic Master Product Update
      • Summary
      • Chapter 3: Understanding Objective-C Protocol and Table View
        • Protocol
          • Implementing the Strategy pattern
            • Defining the protocol
            • Creating a delegate property
            • Declaring protocol methods
        • Creating a sample application using a protocol and a delegate
          • Adding the ViewController class for entering numerical values
          • Defining the protocol, outlets, and action methods in the SecondViewController.h header file
          • Defining the SecondViewController class and connecting controls
          • Invoking delegate methods from the SecondViewController.m implementation file
          • Declaring the delegate, outlet, and action methods in the demodelegateViewController.h header file
          • Defining the demodelegateViewController and connecting controls
          • Implementing the protocol methods in the demodelegateViewController.m file
          • Running the project
        • Introduction to Table View
        • Creating an application to display Table View cells
          • Declaring an array in the header file
          • Implementing UITableViewDataSource protocol methods
        • Adding names to the Table View
          • Adding the AddNameController View controller
          • Defining protocols, outlets, and action methods in the AddNameController.h header file
          • Defining the AddNameController class View and connecting controls
          • Invoking Delegate methods in the AddNameController.m implementation file
          • Invoking the AddNameController View and implementing the protocol methods
          • Placing and connecting the Bar Button Item control in the RootViewController
        • Summary
        • Chapter 4: Designing a Data Model and Building Data Objects for Customers
          • Creating a new project
          • Designing the data model
            • Data Model Editor
            • Adding an entity
            • Adding an attribute property
              • Types of attributes
              • Fields applying constraints
          • Building data objects for the Customer entity
          • Understanding code of autogenerated files
            • Header file of Application Delegate
            • Implementation file of Application Delegate
              • applicationWillTerminate method
              • managedObjectContext method
              • managedObjectModel method
              • persistentStoreCoordinator method
              • applicationDocumentsDirectory method
          • Summary
          • Chapter 5: Creating, Listing, and Deleting Names of Customers
            • Splitting the task into two modules
            • Creating a module to save and delete a customer's name
              • Using the ViewController class for adding the name of the customer
              • Defining protocol, outlets, and action methods in the header file
              • Defining the View of the AddNameController class and connecting controls
              • Invoking delegate methods from the implementation file
              • Declaring delegate and implementing methods for storing the name of the customers
            • Key value coding (KVC)
              • Key value methods
                • The -valueForKey: method
                • The -setValue:forKey: method
                • Keypath
            • Implementing the methods of the NSFetchedResultsControllerDelegate protocol
              • The controllerWillChangeContent method
              • The controllerDidChangeContent method
              • The controller:didChangeObject method
              • The controller:didChangeSection method
            • Running the project
            • Summary
            • Chapter 6: Creating, Listing, Displaying, and Deleting Records of Customers
              • Understanding multiple managed object context
                • NSNotification
              • Applying the concept of multiple managed object context in our application
              • Enhancing our application to save, list, display, and delete customer information
                • Adding the ViewController class
                • Defining a View for entering the customer's information and connecting controls
                • Coding in the implementation file for accepting the customer's information and invoking delegate methods
                • Adding the View Controller class for displaying the customer's information
                • Defining the View and writing the code in the implementation file for displaying the customer's information
                • Implementing the methods in the RootViewController class for storing the customer's information
              • viewDidLoad method
              • cell AtIndexPath method
              • didSelectRowAtIndexPath method
              • addCustomer method
              • addcustomerController method
                • Viewing the project
              • Summary
              • Chapter 7: Updating and Searching Records of Customers
                • Applying the update feature
                  • Defining a protocol in the DisplayCustomerController class
                  • Adding Edit button to enable modifications in the View of DisplayCustomerController class
                  • Implementing the protocol's method for storing modified customer information
                • Using KVO to know what has been updated
                • Running the project
                • Applying search facility
                  • Defining outlet of UISearchBar class in the header file of the RootViewController class
                  • Placing the Search Bar control in the View of RootViewController and specifying its delegate
                  • Implementing delegate method in the RootViewController class to apply searching
                • Understanding NSPredicate
                • Removing the keyboard after selecting a customer's name
                • Using Predicate Builder for creating a search criterion
                  • Fetched properties
                  • Fetch request templates
                    • Building and accessing a fetch request without a variable
                    • Building and accessing a fetch request with a variable
                • Summary
                • Chapter 8: Entering, Saving, Listing, and Deleting the Records of the Products Sold to the Customers
                  • Adding the product entity to the Data Model
                  • Relationship
                    • Types of relationships
                      • One to one relationship
                      • One to many relationship
                      • Many to many relationship
                  • Establishing a relationship between the Customer and the Product entities
                    • Setting a relationship from the Customer entity to the Product entity
                      • Delete rule
                    • Setting a relationship from the Product entity to the Customer entity (inverse relationship)
                  • Building the data object for the Customer and the Product entities
                    • Understanding the role of the auto generated special methods of a relationship
                  • Entering the information of the products sold to the customers
                  • Creating a module to develop an interface to enter the product information
                    • Adding a ViewController class for entering the information of the products sold to the customers
                    • Defining the protocol, outlets, and action methods in the header file
                    • Designing the View of the AddProductController class and connecting the controls
                    • Invoking the delegate methods from the implementation file
                  • Developing a module to create a menu for manipulating the product information
                    • Adding a ViewController class to display the Product's menu to manipulate the product's information
                    • Defining the outlets and action methods in the header file
                    • Designing the View of a ProductInfoController class and connecting the controls
                    • Coding in the implementation file to save, edit, and display the product's information
                  • Creating a module to connect the Product's menu to the rest of the project
                    • Defining the outlets and action methods in the header file
                    • Adding a Toolbar control to the View of the DisplayCustomer Controller class
                    • Coding in the implementation file to invoke the View of the ProductInfoController class
                  • Running the project
                  • Summary
                  • Chapter 9: Entering, Displaying, and Deleting the Stock
                    • Adding the MasterProduct entity to the Data Model
                    • Storing the image of the MasterProduct
                      • Transformable data type
                        • The Value Transformer Name: field
                        • Creating a value transformer
                    • Building the data object for the MasterProduct entity
                    • Maintaining the MasterProduct information
                      • Image Picker
                        • Adding custom images to the Image Picker
                      • Making an image appear within a given size
                      • Module to develop interface to enter the information of the MasterProduct
                        • Adding the ViewController class for entering information of the master products
                        • Defining protocol, outlets, and action methods in the header file
                        • Designing the View of the MasterProductController class and connecting controls
                        • Invoking the delegate and ImagePicker methods from the implementation file
                      • Module to create a menu for manipulating the MasterProduct information
                        • Adding the View Controller class to display a menu for adding, editing, and displaying the MasterProducts
                        • Defining the outlets and action methods in the header file
                        • Designing the View of the MasterProductInfoController class and connecting controls
                        • Coding in the implementation file to save, edit, and display the master product's information
                    • Summary
                    • Chapter 10: Editing the Stock Information
                      • Module to connect the MasterProduct's menu to the rest of the project
                        • Defining outlets and action methods in the header file
                        • Adding a Toolbar and a Bar Button Item in the RootViewController class
                        • Coding in the implementation file to invoke the View of the MasterProductinfoController class
                        • Making the Toolbar to appear at the bottom of the View
                      • Running the application
                        • Selecting the image of the master product
                        • Deleting the master product
                      • Module to modify the information of the master product
                        • Adding the View Controller class to display the view to modify the selected master product
                        • Defining the outlets and action methods in the header file
                        • Designing the View of EditMasterProductController class
                        • Coding in the implementation file to modify the master product's information
                        • Importing the delegate and the View Controller class in the header file
                        • Coding in the implementation file to invoke the View of the EditMasterProductController class
                      • Summary
                      • Chapter 11: Displaying the Products for Sale and Updating the Stock
                        • Displaying the products available for sale
                          • Adding the SearchProductController class
                          • Designing the view of SearchProductController
                          • Coding in the SearchProductController class
                          • Invoking the SearchProductController from the Product menu
                          • Displaying name, price, and image of the selected product
                        • Updating the stock
                          • Running the project
                        • Automatically updating the quantity of the product in the MasterProduct entity
                        • Versioning
                          • Creating a new Data Model version
                        • Migrations
                          • Implementing lightweight migration to our application
                        • Summary

                        B.M.Harwani

                        B.M.Harwani is the founder and owner of Microchip Computer Education (MCE), based in Ajmer, India that provides computer education in all programming and web developing platforms. He graduated with a BE in computer engineering from the University of Pune, and also has a 'C' Level (master's diploma in computer technology) from DOEACC, Government Of India. Being involved in the teaching field for over 16 years, he has developed the art of explaining even the most complicated topics in a straightforward and easily understandable fashion. He has written several books on various subjects that includes JSP, JSF, EJB, PHP, .Net, Joomla, jQuery, and Smartphones. He also writes articles on a variety of computer subjects, which can be seen on a number of websites. To know more, visit his blog, http://bmharwani.com/blog. The list of books written by B.M.Harwani are Programming & Problem Solving through C (BPB, 2004), Learn Tally in Just Three Weeks (Pragya, 2005), Data Structures and Algorithms through C (CBC, 2006), Master Unix Shell Programming (CBC, 2006), Business Systems (CBC, 2006), Practical Java Projects (Shroff, 2007), Practical Web Services (Shroff, 2007), Java for Professionals (Shroff, 2008), C++ for Beginners (Shroff, 2009), Practical ASP.NET 3.5 Projects (Shroff, 2009), Java Server Faces—A Practical Approach for Beginners (PHI Learning, 2009), Practical JSF Project using NetBeans (PHI Learning, 2009), Foundation Joomla (Friends of ED, 2009), Practical EJB Projects (Shroff, 2009), Data Structures and Algorithms in C++ (Dreamtech Press, 2010), Developing Web Applications in PHP and AJAX (Tata McGraw Hill, 2010), and jQuery Recipes (Apress, 2010).

                        Code Downloads

                        Download the code and support files for this book.


                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        Core Data iOS Essentials +    iPhone Location Aware Apps by Example - Beginner's Guide =
                        50% Off
                        the second eBook
                        Price for both: $25.49

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • 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

                        In Detail

                        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.

                        Approach

                        The book follows an unfolding example app, exploring the features and principles of Core Data as they are added to the app. The book is full of step-by-step instructions, clear explanations, and useful quick reference material.

                        Who this book is 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.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Resources
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software