View Single Post
  #4 (permalink)  
Old March 1st, 2011, 10:53 PM
thepianoguy thepianoguy is offline
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

A follow up, since my answer is not fully accurate. (still exploring)
The code as written functions because the observer is added and never removed. Your response about the observer being overwritten is not correct. The -viewWillDisappear is never called, so no observers are ever removed until the program quits.
To illustrate the need to correctly pair notification names when adding and removing observers, I figured that the simplest thing to do would be to add a second view and log the behavior as the views were switched out since the documentation suggests that the -viewWillAppear and -viewWillDisappear will be called when this occurs. Things don't exactly work as expected. Stay tuned…
Bob
Reply With Quote