In my case, the application suddenly started to freeze. Debugging showed that all sockets were still nil during viewDidLoad() .
My application still uses feathers (not storyboards) for most view controllers. Everything was in place, all sockets were connected correctly. I double checked.
Usually we create our view controllers as
let newVC = MYCustomViewController()
... which for some reason seems to work as long as .xib is named the same as the view controller class (although not sure how it works. We do not call init(nibName:bundle:) with null arguments or override init() do it on self , as usually suggested ...).
So I tried to explicitly call
let newVC = MYCustomViewController(nibName: "MYCustomViewController", bundle: .main)
... only welcome with runtime exception error:
*** The application terminated due to an unsuccessful exception "NSInternalInconsistencyException", reason: "Failed to load the NIB bundled:" NSBundle & lt; / Users / nicolasmiari / Library / Developer / CoreSimulator / Devices / 3DA3CF21-108D-498F-9649 -C4FC9E3C1A8D data / Containers / Bundle / Application /C543DDC1-AE86-4D29-988C-9CCE89E23543/MyApp.app & GT; (loaded) 'named' MYCustomViewController ''
And then I saw this:
The Target Membership checkbox in the .xib file has not been set.
This could happen if one of the common merge conflicts associated with the Xcode project file is resolved.
Apple should definitely come up with a project file format that is more SCM friendly.
Nicolas Miari 03 Sep '18 at 2:20 2018-09-03 03:20
source share