Saturday, April 26, 2025
HomeiOS Developmentios - Can not load xib from framework

ios – Can not load xib from framework

[ad_1]

I can not seem to load a nib file within the framework I’ve created. The factor is I labored on it for greater than a month and it was working positive. I opened it once more right this moment after 2 weeks and it is simply crashing. I could not imagine it.

I’ve created a tiny pattern undertaking the place I’m able to reproduce the problem.

To get the Bundle I’m utilizing

let bundle = Bundle(identifier: "com.nibFramework.NibFramework")

That is returning nil btw.

So I attempted

let bundle = Bundle(for: MyNib.self)

Utilizing the nib

let nib = UINib(nibName: "(MyNib.self)", bundle: bundle)
let array = nib.instantiate(withOwner: self, choices: nil)

And that is crashing on instantiate.

Error
2021-11-23 23:55:52.381944+0530 NibApp[7432:2147418] *** Terminating app resulting from uncaught exception 'NSInternalInconsistencyException', cause: 'Couldn't load NIB in bundle: 'NSBundle </personal/var/containers/Bundle/Software/7817FD25-54BC-4920-AC67-49D246D28794/NibApp.app> (loaded)' with identify 'MyNib''
*** First throw name stack:
(0x1827f904c 0x19ae6df54 0x182850180 0x18513f338 0x1040b0d9c 0x1040af164 0x1040af1c0 0x184db415c 0x184db6c10 0x184d896a4 0x184ecc4d8 0x184e21da0 0x184eb8f84 0x184ed3598 0x184c594a0 0x184f5f584 0x185260400 0x184f61c80 0x184ea10b4 0x1942f0e20 0x194316cdc 0x1942d16b4 0x1942d2cf4 0x10441e3b4 0x104421e70 0x1942d2f94 0x1942d23d4 0x1942d69e4 0x18281b020 0x18282bce0 0x182766054 0x18276b7f4 0x18277f3b8 0x19e10f38c 0x18511f6a8 0x184e9e7f4 0x199e98184 0x1040afcb8 0x1040afc40 0x1040afd38 0x104325a24)
libc++abi: terminating with uncaught exception of kind NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app resulting from uncaught exception 'NSInternalInconsistencyException', cause: 'Couldn't load NIB in bundle: 'NSBundle </personal/var/containers/Bundle/Software/7817FD25-54BC-4920-AC67-49D246D28794/NibApp.app> (loaded)' with identify 'MyNib''
terminating with uncaught exception of kind NSException

I’m utilizing Xcode 13.1. The Mach-O Kind of this framework is ready to Static Library.

Fairly certain I’m lacking some easy factor. Simply cannot work out what. Thanks on your assist.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments