============================================================
博文原创,转载请声明出处
============================================================
刚从非arc专项arc,发现dealloc函数并没有被调用。后来发现,是我在block代码中,引用了self,造成了循环引用。
解决方法,只要使用__weak 来引用self即可。如下
错误代码
[_svItems addInfiniteScrollingWithActionHandler:^{
[self refreshBottom:nil];
}];
正确代码
__weak ForumContentViewController* refself=self;
[_svItems addInfiniteScrollingWithActionHandler:^{
[refself refreshBottom:nil];
}];
ref:http://stackoverflow.com/questions/9219030/dealloc-not-being-called-on-arc-app