I've just started working with Core Data, and I've got what I hope is an easy question for one of you guys with more experience. Using the standard navigation-based project template with core data for storage, I've set the project up so that when the "Add" button is pressed from the root view, instead of immediately adding an object, the ABPeoplePickerNavigationController is called to allow my user to select a contact.
This works swimmingly so far, but I have a problem: when I tap "Cancel" from within the peoplePicker, the insertObject: method just keeps right on going, and inserts a new object. How do I gracefully exit the insertObject: method when the "Cancel" button is tapped from within the peoplePicker?
As ever, thanks in advance for your assistance.
EDIT: After staring at the code some more, I think I may have answered my own question. It would appear that the thing to do is to move the template-provided "insertObject:" code into the "peoplePickerNavigationController:shouldContinueAfterSelectingPerson
roperty:identifier:" method, wherein it would be called if and only if the user selects the property. If the "cancel" button is pressed at any time, "peoplePickerNavigationControllerDidCancel:" would be called before the code to add the object to the store. Right?
This works swimmingly so far, but I have a problem: when I tap "Cancel" from within the peoplePicker, the insertObject: method just keeps right on going, and inserts a new object. How do I gracefully exit the insertObject: method when the "Cancel" button is tapped from within the peoplePicker?
As ever, thanks in advance for your assistance.
EDIT: After staring at the code some more, I think I may have answered my own question. It would appear that the thing to do is to move the template-provided "insertObject:" code into the "peoplePickerNavigationController:shouldContinueAfterSelectingPerson