Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grandM

macrumors 68000
Original poster
Oct 14, 2013
1,568
329
Hi there

I'm adding an observer to NotifationCenter in a tab of a tab bar controller. At the moment this observer is added in viewDidLoad(). This implies I first need to open that tab to put the observer on it. Does anyone know a way to add that observer without having the tab opened before?

Thanks
 
The obvious place is in the appropriate init method. Read the docs to understand which one gets called in your scenario.

Remember that you can’t access the UI elements until viewDidLoad gets executed.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.