I want to add a view controller as observer of a notification.
When the selector method is called, I'll alert the user. I would that this alert appears only when this view controller is the top view controller.
I thought to add it as observer in the viewDidLoad
method. But where is the better remove the view controller as observer?
Could it be a problem if I remove it both in viewDidUnload
and dealloc
?