removeObserver with NSNotification… what am I doing wrong?

前端 未结 3 1384
终归单人心
终归单人心 2020-12-28 14:59

Basically, I have a view1 which at some point, calls view2 (via presentModalViewController:animated:). When a certain UIButton in view2 is pressed,

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 15:54

    There is nothing wrong putting removeObserver: in dealloc. Just the fact it's not called means view1 not properly releases after dismissing. Looks like something holds pointer to your view1, check for retain cycles.

    Also, you shouldn't call dealloc on super.

提交回复
热议问题