NoBody
NoBody

Reputation: 719

Add a Storyboard in a existing XIB Project

I use in my project only xib files. Now i need a static tableview for a settings view. I want to combinied xib and one storyboard(for the tableview).

I add a storyboard with one viewcontroller in my projekt. After than i add a identifier(SettingsView) for this viewcontroller. the following code is executed when the button was pressed:

SettingsView *CustomViewController = [[UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SettingsView"];
[self presentModalViewController:CustomViewController animated:YES];

My Application crashed when i push the setting button:

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard () doesn't contain a view controller with identifier 'SettingsView''

Upvotes: 0

Views: 1230

Answers (2)

Paramasivan Samuttiram
Paramasivan Samuttiram

Reputation: 3738

Please make sure that you added the StoryBoard ID as follows in the picture attached.

enter image description here

Upvotes: 1

heckman
heckman

Reputation: 499

The storyboard and individual view controller that you are attempting to instantiate, names have match exactly. Otherwise, the rest of what you are doing is correct from what I can see.

Upvotes: 0

Related Questions