objective c - Remove KVO observer issue -


I have a menu controller that is connected to the visual context with a weak reference. View Controller is in the context of the menu controller.

The menu controller views some of the collection views in the view controller when the menu controller is deleted, then I delete [self.viewController.collectionViewAbusverver: for myself: the keypath: keypath]; , but in this place itself ViewController is already zero.

In what place do I remove the KVO Supervisor?

I believe that you do this in another way you should add the supervisor to the View Controller , Not in the menu controller:

  [Object addObserver: menuController forKeyPath: @ "openingBalance" ...];   

Just pass the menu controller as a logic for the addObserver: method and apply the ValavForKeyPath: method in the menu controller .

You can remove the supervisor when you need it (I believe you want to do it in the delok method), still in view controller, in that scenario when your view controller If it will be canceled, then remove it from the supervisor first.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -