-2
我從下面的塊中產生內存泄漏。我很肯定下面的對象會越來越糾結。我試圖用(弱)關係來設置它們,但是這並沒有成功。任何想法如何我可以打擊/改寫這個問題?謝謝。內存泄漏問題iOS
AssistHub.m
@implementation
- (void)startGameWithBlock:(void (^)(Game *))block
{
_viewControllerGame = [[GameViewController alloc] init];
_viewControllerGame.delegate = (id)self;
Game *game = [[Game alloc] init];
_viewControllerGame.thisGame = game;
game.delegate = _viewControllerGame;
block(game);
}
參考這篇文章http://stackoverflow.com/questions/10707143/can-using-weak-attribute-to-pass-參數對塊導至內存泄漏 – Natarajan