NSNotification removeObserver problem

前端 未结 1 1664
南方客
南方客 2021-02-19 18:10

I am either brain damaged or I am lacking of some understending of NSNotificationCenter

The problem is that if I create an observer and in the next line will try to dele

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-19 18:51

    You're removing observer for keypath, not for notification name. The removal should be something like this:

    [[NSNotificationCenter defaultCenter] removeObserver:self
                                                    name:@"ClearVisibleMaps"
                                                  object:nil];
    

    0 讨论(0)
提交回复
热议问题