dismissViewControllerAnimated crash at ios5

前端 未结 2 1586
猫巷女王i
猫巷女王i 2020-12-21 23:01

Does the code crash, because of a circular reference?

MenuController: UIViewController

- (id)initWithNibName:
{...
TabsController *tabs = [[TabsController a         


        
2条回答
  •  北海茫月
    2020-12-21 23:28

    Your question is a little difficult to understand, but I gather you have a retain-cycle:

    ObjectA retains ObjectB
    ObjectB retains ObjectA
    

    and neither object gets deallocated?

    Your property for the tabDelegate should read:

    @property (nonatomic, assign) id tabDelegate;
    //                    ^^^^^^-This is the important bit, this stops the retain cycle.
    

提交回复
热议问题