2
我试图运行以下代码,除非发送NSNotification
。我无法弄清楚如何把NSNotification
if语句:如何在if语句中检查NSNotification
if (!self.subViewControllerProv) {
self.subViewControllerProv = [[ProvViewController alloc] init];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleNotification:) name:@"SomeNotification" object:nil];
来回顾一下:如果遵守了NSNotification
消息,那么alloc
和init
的ProvViewController
如果不是的话就不要。