Neon Cracklin
Neon Cracklin

Reputation: 3

Could not find a storyboard named 'Main' in bundle NSBundle?

While trying to localize a SpriteKit game i suddenly started getting the error:

"Could not find a storyboard named 'Main' in bundle NSBundle"

I wasn't use a storyboard, and i think i actually deleted the file when i first started developing the game. 'Main storyboard file base name' was set to 'Main' (was set before as well when it worked and there was no storyboard). I deleted that entry and now the program just executes the AppDelegate file and essentially stops. What's missing where before it would automatically execute the root view-controller and now it does not?

I've tried the following in the app delegate:

*self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
FirstViewController *First = = [[FirstViewController alloc]init];
[self.window setRootViewController: First];
[self.window makeKeyAndVisible];

but when it moves to the FirstViewController it crashes here:

SKView * skView = (SKView *)self.view;
skView.showsFPS = YES;

But before i never needed that first snip it of code to execute the root view controller. Any ideas what might have went wrong? It all started during a blur of Localizing, Cleaning, Changing Languages, deleting Localizable.string files, etc....

Upvotes: 0

Views: 2657

Answers (1)

tripleshotsw
tripleshotsw

Reputation: 61

"... Cleaning..."

The SpriteKit app template includes a Main.storyboard & is used as the view that the GameScene is loaded into. It's quite possible that you removed it and went on working fine until cleaning the project much later; at least it's my experience that after removing a storyboard or other resource you really want to do a clean and a build right away to find out if you broke something, as they seem to end up in the generated bundle for a while after being deleted.

Your current code creates a FirstViewController, but I can't see if you handle all the layout properly in the init method, but since you're crashing, maybe not?

I like storyboards so if I were you I'd create a new spritekit game project so you can grab the Main.storyboard out of it, but if you'd really rather fix the code that you have I think we might need to see FirstViewController.m

Also, what message you get in the debugger when it crashes would probably be helpful to getting a better answer as well.

Upvotes: 1

Related Questions