0

I am getting this crash issue when dragging the Control centre while using my app. Crash message is [ViewController tableView:viewForHeaderInSection:]: message sent to deallocated instance 0x17dbb9a0

Code is:

- (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;
}

I am using Xcode 6 and enabled ARC . Could any one please help me to resolve this issue.

I have tried to take the help of Properties but doesn't work. Thank you for reading my post.

Tendulkar
  • 5,550
  • 2
  • 27
  • 53

1 Answers1

-1

delegate of your tableview is deallocated whenever viewForHeaderInSection is called. make sure your viewcontroller is the delegate and check when and where it is getting deallocated.