1

I have built a framework in Xcode that I use in multiple projects. The framework has a storyboard that I load conditionally.

I am a stickler about eliminating compiler warnings and I have just 1 warning in my entire project:

“uiframework“ is unreachable because it has no entry points, and no identifier for runtime access via -[NSStoryboard instantiateControllerWithIdentifier:] [9]

I don't understand the warning.

I am instantiating the storyboard in my code like this:

NSBundle *bundle = [NSBundle bundleWithIdentifier:@"com.foo.uiframework"];
NSStoryboard *sb = [NSStoryboard storyboardWithName:@"uiframework" bundle:bundle];

// if no identities then show welcome view
if (identities.size() == 0) {
    welcomeVC = [sb instantiateControllerWithIdentifier:@"Welcome"];
    self.view.window.contentViewController = welcomeVC;        
} else {
    [Utils activationComplete];
}

So what exactly does the compiler want me to do here?

Partial screenshow of Xcode and the storyboard showing there is an entry point and it's the Welcome Scene

enter image description here

Similar question here but not the right solution

spartygw
  • 3,289
  • 2
  • 27
  • 51
  • Silly question, but worth double-checking: does `[sb instantiateControllerWithIdentifier:@"Welcome"];` actually work? – Alexander May 18 '21 at 21:41
  • Have you included your uiframework in this source file? – jvarela May 19 '21 at 08:19
  • @Alexander it does work. Not a silly question at all. – spartygw May 19 '21 at 15:05
  • @jvarela sorry, not clear to me what you're asking. The framework works, the 2 apps that I build using it both work, just produces this warning at compile time. – spartygw May 19 '21 at 15:09
  • 1
    Can you provide a GitHub project where you can reproduce this problem? – jvarela May 19 '21 at 19:47
  • @jvarela - I distilled my project down to something I could put on github and the error went away. That caused me to go back and look at what I removed for github and I found I had a scene in my main storyboard (not the uiframework storyboard that I showed in the screenshot) called `uiframework`. Doh! If you hadn't asked for a github sample I don't know that I would've found it b/c my main storyboard is quite large. Thanks man! – spartygw May 20 '21 at 15:16

0 Answers0