'Begin Editing on Insert' with Core Data?


#1

In Chapter Nine, we are shown how to ‘Begin Editing on Insert’ on page 149.
Is there an easier way/another way to add that same functionality to the ‘NEW’ button in the CarLot app?


#2

[quote=“glennwark”]In Chapter Nine, we are shown how to ‘Begin Editing on Insert’ on page 149.
Is there an easier way/another way to add that same functionality to the ‘NEW’ button in the CarLot app?[/quote]

A quick Google search for “core data edit on insert”: friday.com/bbum/2006/05/18/c … on-insert/

EDIT: typo s/cora/core/


#3

Thanks, but that is pretty much exactly how it is done on pages 149-151. I figured there might be an easier way than having to work around the built in core data add method. Like a delegate method in the tableView or NSPersistentDocument. Or something in IB like ‘nextKeyView’ that let’s us point to and edit. In the future I’ll probably create my own custom object, something generic that can be a delegate to NSPersistentDocument. One thing at a time and I don’t mind the practice. Maybe I’ll find out more when I get to the next core data chapter, thirty I think.

Note: The example in the link you sent appears to have forgotten to add undo. I haven’t tried it, but Core Date sets up undo, and if they are basically working around the add method, they would also have to setup the undo. Assuming they want to retain undo. Again as on page 149-151.

Also Note: Be sure to scroll down in the link to see Aaron’s response that cleans up the code.