Dealloc Not Running When Dismissing Modal View from Block

后端 未结 3 1987
南笙
南笙 2020-12-12 04:32

Strange one here, dealloc is not being called when dismissed from inside a block. Code:

[[NSNotificationCenter defaultCenter] addObserverForName:@\"user.logi         


        
3条回答
  •  我在风中等你
    2020-12-12 05:19

    I refer you to: Reference Counting of self in Blocks

    The block will retain self until the block is released. So to dealloc self, you'll need to remove the observer.

提交回复
热议问题