I want to show a Now Playing button in a UINavigationController's bar.
I have a class (NowPlayingManager) that I am using to keep track of whether an audio file is currently being played. I use a notification posted in another class (AudioViewController) to indicate playing status. AudioViewController creates an instance of the NowPlayingManager with alloc/init and releases it. In NowPlayingManager's target of the received notification I set NowPlayingManager's isNowPlaying Boolean to YES.
When the audio stops playing I send another notification that sets the isNowPlaying bool to NO.
However, each time the class is initialized the bool is set to NO, which makes sense because it is a new instance of NowPlayingManager and the Now Playing button is never displayed.
How can I get the isNowPlaying bool to persist through all instances of my NowPlayingManager? Or, rather, Should I have the app delegate init the NowPlayingManager rather than AudioViewController so that only one instance is created?