Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In this chapter, we will see how to modify the information of the customer is unlike the Editing feature in Chapter 6, Creating, Listing, Displaying, and Deleting Records of Customers, which was limited to deletion of records. We will see how to Update (modify) the information of the customers that is already stored with us. In the last chapter, we saw that when any customer's name is selected from the table view, we are navigated to a View that displays detailed information of the customer, which includes the customer's name, e-mail ID, and contact number. This information is displayed via non-editable Text Fields so that the user can just look at the information without being able to modify it. In this chapter, we will learn about a procedure to add an Edit button at the top of the View that displays information of the selected customer. The Edit button when selected will make the Text Fields (through which a customer's information is displayed) editable allowing us to modify the information displayed in the Text Fields. We will also see how to save the modified information back to the persistent store.
We will also be using KVO (Key Value Observing) to know what attribute of the object is updated. Besides this, we will also see the application of NSPredicate to apply search facility to locate the desired customer name quickly.