Inconsistent Exception: Could not load nib in bundle, from loadNibNamed method-Collection of common programming errors
I have an iOS 6 app that is inconsistently throwing an NSInternalInconsistencyException:
Could not load NIB in bundle: 'NSBundle (loaded)' with name 'MyNib'
I am seeing this exception show up in my crash logs from users, but have not been able to reproduce it myself. Due to the frequency of the crashes, it is clearly not happening every time, but is happening.
The root view controller of my app is loading this particular nib via the following call inside my -viewDidLoad
method.
NSArray *xib = [[NSBundle mainBundle] loadNibNamed:@"MyNib" owner:self options:nil];
I can think of reasons that this exception would be thrown, but in all of those cases, it would be thrown every time the app was launched, not just sometimes.
Can anyone suggest a reason that attempting to load a nib might inconsistently throw this exception? Is there any way something happening on another thread might interfere with the loading? (To be clear, the crash logs to confirm that the load is happening on the main thread when the exception is thrown).
Thanks!