我想在UINavigationController的酒吧展示一个现在的游乐纽。
我有一个班子(NowPlayingManager),我正在利用这个班子来跟踪一个声音档案是否正在发挥作用。 我使用另一班(AudioViewController)上张贴的通知来表明竞争状况。 录音记录员对现在PlayingManager的节目和节目进行播放。 在目前PlayingManager, 收到通知的目标,我向YES投了通知。
当音频站起作用时,我又向NowPlaying bool发送了通知。
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?