草庐IT

NSNotificaitonCenter

全部标签

ios - 无法在 NSNotificaitonCenter 的 addObserver : selector: name: object: method 中使用 UIApplicationDidEnterBackgroundNotification 作为名称

我将一个文件复制到一个新项目中,它似乎工作正常。这段代码也在旧项目中工作,但突然之间(在新项目中),我遇到了几个我无法弄清楚的错误。NSNotificationCenter*center=[NSNotificationCenterdefaultCenter];[centeraddObserver:selfselector:@selector(saveBookmarks)name:UIApplicationWillTerminateNotificationobject:nil];[centeraddObserver:selfselector:@selector(saveBookmarks