0

My app is crashing, but it I can't seem to locate the problem.

After startup, I call performSegueWithIdentifier to move the user to the right ViewController. This works, except on iPads running iOS 8 (specifically it seems to happen on 8.3, 8.4 and 8.4.1 so far). Newer iPads and iPhones are no problem.

The app has a SplitViewController (which is created when calling the performSegueWithIdentifier mentioned earlier), so perhaps this has something to do with the problem, since it's displayed differently on iPads than on iPhones.

The exact error is:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'I9T-iy-59z-view-exp-vQ-8nn'

Kevin R
  • 8,230
  • 4
  • 41
  • 46
  • is there any view controller named as `I9T-iy-59z-view-exp-vQ-8nn` you declared in your viewcontroller – Anbu.Karthik Apr 22 '16 at 09:24
  • I'm not sure how to search for that? – Kevin R Apr 22 '16 at 09:25
  • i think ur viewcontroller name is not matched please check once – Anbu.Karthik Apr 22 '16 at 09:27
  • Looks like you have given wrong bundle in the method parameter. – Bhaumik Desai Apr 22 '16 at 09:29
  • Why would this only occur on iOS8 then? And not on 9? – Kevin R Apr 22 '16 at 09:51
  • I would open the Storyboard file as Source Code and search for I9T-iy-59z-view-exp-vQ-8nn. – dasdom May 02 '16 at 13:02
  • @dasdom I tried that, but it doesn't even seem to exist anywhere. I have no idea where this identifier is being determined. – Kevin R May 02 '16 at 13:19
  • I doubt he has any VC named `I9T-iy-59z-view-exp-vQ-8nn` as one would remember such a peculiar name in his project. Plus if there indeed was such a VC in use, bug should not be confined to iOS 8 only. – NSNoob May 02 '16 at 13:22
  • @KevinR did you rename any of files outside xcode? That can some times cause that issue. If you did, remove those files and add them again. Clean the project and run it again – NSNoob May 02 '16 at 13:24
  • Just did a quick search on SO. [This answer](http://stackoverflow.com/questions/27842740/nsinternalinconsistencyexception-reason-could-not-load-nib-in-bundle) lists a number of possibilities which could be the cause. See if anything is amiss. – NSNoob May 02 '16 at 13:26
  • Maybe it's due to adaptive segues. They are unavailable prior to iOS9. – Crazyrems May 02 '16 at 13:26
  • @NSNoob: I can confirm this is something related to iOS8, I can reproduce the error using an 8.4 iPad simulator. the iOS9 sim works just fine. @dasdom I did more searching, the name is actually made up out of two parts. a VC with id `I3T-Sm-59z` which contains a view with id `exp-vQ-CBj` But it means it does exist at least. – Kevin R May 02 '16 at 13:27
  • I believe the encoded name is an internal creation of storyboards that they use to identify a "scene". It's treated as an embedded NIB, similar to the content of a .xib file. – Phillip Mills May 02 '16 at 13:27
  • @PhillipMills Seems like a good direction to look in, but I'm not sure why it's not valid in iOS8. – Kevin R May 02 '16 at 13:44
  • @Crazyrems Are you sure? I use those everywhere, seems to work okay (on iPhones it seems to fine for example)? But I do agree I'm thinking I must do something that's not allowed/available in iOS8, the error is too vague to figure it out though :(. – Kevin R May 02 '16 at 13:44
  • @KevinR I have no idea what's causing your error but some people seemed confused about where the string was coming from. – Phillip Mills May 02 '16 at 13:46
  • As a test, if you link the same segue to a different kind of view controller, do you get the error? – Phillip Mills May 02 '16 at 13:48

1 Answers1

1

This may be considered an iOS bug. I couldn't find any Open Radar or bug report, but have a look to this questions:

1 Terminating app: Could not load NIB in bundle: 'NSBundle ...' with name '7bK-jq-Zjz-view-r7i-6Z-zg0'

2 Could not load NIB in bundle: 'NSBundle when using storyboarding

So I would suggest to insert a UINavigationController between the UITabBarController and each of the UITableViewController child views. as this answer: https://stackoverflow.com/a/31196701/821053

Alternatively, you can get rid of the storyboard segues from Master & Detail and add them programmatically:

let master = self.storyboard?.instantiateViewControllerWithIdentifier("SplitMasterController")
let detail = self.storyboard?.instantiateViewControllerWithIdentifier("SplitDetailController")
self.viewControllers = [master!, detail!]
Community
  • 1
  • 1
Pau Senabre
  • 4,155
  • 2
  • 27
  • 36
  • YES! This is it! I ended up using the workaround, as it's the least invasive, specifically, I removed the master and detail segues from the storyboard and added them in the `viewDidLoad`. I'll update your answer to show what I mean :). – Kevin R May 03 '16 at 08:00