Configuring ItemVC for the Unit Picker
The Assistant Editor was used to create a reference to the unit picker text field through a new unitPickerTextField
property. For picker text fields to send selected values back to the text field, the ItemVC
needs to adopt the CoreDataPickerTFDelegate
protocol.
Update Grocery Dude as follows:
1. Update ItemVC.h
to adopt the CoreDataPickerTFDelegate
protocol. For convenience, Listing 7.7 shows what ItemVC.h
should look like once this update has been made.
#import <UIKit/UIKit.h>#import "CoreDataHelper.h"#import "UnitPickerTF.h"@interface ItemVC : UIViewController<UITextFieldDelegate,CoreDataPickerTFDelegate>@property (strong, nonatomic) NSManagedObjectID ...
Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.