当前需要监听页面添加这个通知的话,会造成标题描述问题

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil];

要想解决,只需要把通知换成下面的就ok了,这样程序启动进入主页面时候,不会执行通知,只会单独执行viewWillAppear

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive) name:UIApplicationWillEnterForegroundNotification object:nil];

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注