草庐IT

appDidEnterBackground

全部标签

ios - 以编程方式触发 UIAlertController 的 UIAlertAction

我想在我的应用程序进入后台时通过单击“取消”按钮关闭我的UIAlertController。我已经设置了后台通知[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(appDidEnterBackground)name:UIApplicationDidEnterBackgroundNotificationobject:nil];然后在我的appDidEnterBackground函数中我有:-(void)appDidEnterBackground{if(_alertController){UIAle