O'Reilly logo

Core Data iOS Essentials by B.M. Harwani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating the stock

The implementation file of the AddProductController class (AddProductController.m) is modified to save the information of the product sold to the selected customer. Not only will the implementation file save the information of the product sold but, will also update the stock; the quantity of the product sold will be reduced from the inventory, that is, from the stock maintained in the MasterProduct entity. For example, if the initial quantity of Milk is 100 bottles (in the MasterProduct entity) and three bottles are sold to the customer, the quantity of the product left in the MasterProduct entity will be 97 bottles. Only the statements that are highlighted are added to the file and rest of the code is same as we saw in Chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required