在使用我的应用程序时拖动控制中心时出现此崩溃问题。崩溃的消息是[ViewController tableView:viewForHeaderInSection:]: message sent to deallocated instance 0x17dbb9a0
section方法中的viewForHeader崩溃问题
代码是:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if(section == self.groupsArray.count)
{
customView = [[UIView alloc] initWithFrame:CGRectMake(10.0, 0.0, 300.0, 24.0)];
[customView setBackgroundColor:[UIColor clearColor]];
return customView;
}
return nil;
}
我使用的Xcode 6并启用ARC。任何人都可以帮我解决这个问题。
我试图借助属性的帮助,但不起作用。感谢您阅读我的文章。
哪一行发生此错误?你使用了一个异常断点吗? – ZeMoon 2014-10-29 09:31:27
问题是你的ViewController实例。这是被释放的对象。这种方法涉及的只是一个症状。你应该展示你如何创建和呈现ViewController – 2014-10-29 09:32:08
嘿@ZeMoon我已经使用了断点,但并没有在viewForHeaderInSection方法中显示错误 – Tendulkar 2014-10-29 09:43:17