0

I've implemented workflow that uses a table view and a detail view with a navigation bar. I have been using the viewWillDisappear: message on the detail view to save the user's work, which I like because it makes sense intuitively, but it also gives the chance to set a cancel flag if the user wants to discard their work.

However, when I add the ability to take a picture to the workflow, it means that the viewWillDisappear: now is called both when the user goes back to the table and when going to the camera view. Is there a technique or method I can implement to make it so that the user's work is saved when going back to the table, but half finished work isn't saved when going into subviews?

Dan Monego
  • 9,637
  • 6
  • 37
  • 72

1 Answers1

1

You can check if a the detail view is being popped in the viewWillDisappear: method. The solution would be something similar to the answer to this question:

viewWillDisappear: Determine whether view controller is being popped or is showing a sub-view controller

Community
  • 1
  • 1
yabada
  • 967
  • 1
  • 9
  • 16