iOS6 UIPickerView memory leak issue.

ε祈祈猫儿з 提交于 2019-12-05 07:53:58

Thanks for your info. Was confused by this leak. Only few comments:

  • probably lblRow should be autoreleased: return [lblRow autorelease];

  • [pickerView rowSizeForComponent:component] can be used to get size for new label.

I used IUIPicker in a popover and every time I dismissed the popover I had memory leak. I am also using ARC, so the easiest way I resolved this was by setting the UIPickerView = nil on unload. The following appears to have done the trick.

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.pickerView = nil;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!