Getting Error on iOS 17 for NSInternalInconsistencyException

In iOS 17 Im getting following error :

Alert NSInternalinconsistencyException-UlViewController is missing its initial trait collection populated during initialization. This is a serious bug, likely caused by accessing properties or methods on the view controller before calling a UlViewController initializer. View controller: <HamburgerMenuViewController: 0x11307de00>

It works on 16.7.1. It is a blocker in iOS 17

You got an Obj-C exception saying that your app is using UIViewController incorrectly. Specifically, it's saying that, instead of doing something like:

     viewController = [[HamburgerMenuViewController alloc] init…];
     … viewController.someProperty …

you are doing something like:

     viewController = [HamburgerMenuViewController alloc];
     … viewController.someProperty …

I don't mean that you have lines of code like this, but something in your app is in effect using a view controller reference after alloc but before init.

This is an issue you should debug directly. You can use Xcode to set an Obj-C exception breakpoint that will trigger on any Obj-C exception, look at the backtrace to see where in your code this is happening.

It's very unlikely this is a bug in UIViewController or in the storyboard/NIB loading process, because that would likely show up as a crash in many, many apps, and there's no such trend. More likely, if this is not the direct result of your own source code, is that you're using a 3rd party library that needs to be updated for compatibility with iOS 17.

Getting Error on iOS 17 for NSInternalInconsistencyException
 
 
Q