Why is this over-releasing? UINavigationController / UITableview

后端 未结 1 1038
生来不讨喜
生来不讨喜 2021-02-14 10:52

I\'m pushing a view controller onto my navigation controller\'s stack from within my TableViewController\'s didSelectRowAtIndexPath method as so:

MyViewControlle         


        
相关标签:
1条回答
  • 2021-02-14 11:19

    You're looking in the wrong place -- the problem is that myViewController is getting released (or autoreleased) too many times.

    The code you have posted looks correct, so I'd look at MyViewController's code to see if it ever releases itself, or somehow causes itself to be released by other means.

    You could also override the release method, set a break point and see if you can narrow it down that way... e.g.

    - (void)release {
        [super release]; //Set breakpoint here
    }
    
    0 讨论(0)
提交回复
热议问题