jjzjj

gpsObserver

全部标签

iphone - 为什么不从 NSNotificationCenter :addObserverForName:usingBlock get called 中删除观察者

我对为什么在以下代码中从未删除观察者感到困惑。在我的viewDidAppear中,我有以下内容:-(void)viewDidAppear:(BOOL)animated{idgpsObserver=[[NSNotificationCenterdefaultCenter]addObserverForName:FI_NOTES[kNotificationsGPSUpdated]object:nilqueue:[NSOperationQueuemainQueue]usingBlock:^(NSNotification*note){NSLog(@"runonce,andonlyonce!");[

iphone - 为什么不从 NSNotificationCenter :addObserverForName:usingBlock get called 中删除观察者

我对为什么在以下代码中从未删除观察者感到困惑。在我的viewDidAppear中,我有以下内容:-(void)viewDidAppear:(BOOL)animated{idgpsObserver=[[NSNotificationCenterdefaultCenter]addObserverForName:FI_NOTES[kNotificationsGPSUpdated]object:nilqueue:[NSOperationQueuemainQueue]usingBlock:^(NSNotification*note){NSLog(@"runonce,andonlyonce!");[