super initWithFrame returned nil from -traitCollection, which is not allowed

192 views Asked by At

I'm running one of my Objective-C project on XCode 12.0. I have UIControl subclass "SeatingPanelControl" from which another subclass is created named "IpadSeatingPlanControl", wherein I'm getting crash while executing the below code with exception as mentioned the title (also given in screenshot):

//IpadChamberViewController.m
self.seatingPlanControl = [[[IpadSeatingPlanControl alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height * 4/7,[self.view bounds].size.width,[self.view bounds].size.height * 3/7 + 20.0)] autorelease];

enter image description here

UPDATE (Solution):

I figured out the cause of the issue. I removed one line of code by mistake while fixing the issue with IMP for XCode 12. It was running okay for iPhone, but not for iPad as per current setup of the code. Restoring the line of code fixed the problem.

enter image description here

1

There are 1 answers

6
Phil Dukhov On

Check out that your IpadChamberViewController calls [super init...] in his initializer