Hi,
I'm going through Apple's NSPersistentDocument tutorial, and I have one problem... On the page "Cut" in the tutorial (http://developer.apple.com/document...rial/05_CopyAndPaste/chapter_6_section_5.html), there is code that you need to add to allow deleting Employees from Department (both from a relation between entities and from the managed object context). It says that you just need to call deleteObject: on the context and that's all.
The thing is, this doesn't work for me. When I press Cmd+X, an employee isn't deleted from the table. I've found some other example somewhere on the web, which also added [context processPendingChanges] after the delete, and when I added that, it started working. But why didn't it work without that, if the tutorial doesn't mention that you need to call that method? Is the tutorial wrong, or am I doing something wrong? Can anyone please clarify this to me?
Best regards,
Jakub
I'm going through Apple's NSPersistentDocument tutorial, and I have one problem... On the page "Cut" in the tutorial (http://developer.apple.com/document...rial/05_CopyAndPaste/chapter_6_section_5.html), there is code that you need to add to allow deleting Employees from Department (both from a relation between entities and from the managed object context). It says that you just need to call deleteObject: on the context and that's all.
The thing is, this doesn't work for me. When I press Cmd+X, an employee isn't deleted from the table. I've found some other example somewhere on the web, which also added [context processPendingChanges] after the delete, and when I added that, it started working. But why didn't it work without that, if the tutorial doesn't mention that you need to call that method? Is the tutorial wrong, or am I doing something wrong? Can anyone please clarify this to me?
Best regards,
Jakub