Configuring ItemVC for the Location Pickers

To ensure the home and shop location pickers are refreshed with the latest data like the unit picker, the respective fetch methods need to be exposed. Likewise, the fetch and reloadAllComponents call will need to be implemented, too. Listing 7.14 shows the new code involved in bold.

Listing 7.14 ItemVC.m: textFieldDidBeginEditing

- (void)textFieldDidBeginEditing:(UITextField *)textField {if (debug==1) {    NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));}    if (textField == self.nameTextField) {        if ([self.nameTextField.text isEqualToString:@"New Item"]) {            self.nameTextField.text = @"";        }    }    if (textField == _unitPickerTextField ...

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.