0

I'm developing a small app just to learn iOS, and I'm stucked in a situation with the StoryBoard and a ViewController which apparently exists, but when I run the app the compiler throws me a NSInvalidArgumentException.

The error is the following one:

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

As you can see in the following picture, the StoryboardID has been set up

Identity Inspector

The code which calls the ViewController is the following:

 UIViewController* vc = [self.storyboard instantiateViewControllerWithIdentifier:@"recivedPushViewController"]; vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:vc animated:TRUE completion:NULL]; 

Can anyone help me??

Thank you so much

5
  • 1
    See answers on this question: stackoverflow.com/questions/19007882/… Commented Jul 21, 2014 at 12:36
  • Make sure only one storyboard you have or not.It's look like identifier name also looking good no issue with that.Try to clean the build and run. Commented Jul 21, 2014 at 13:40
  • @Milena i've tried this solution, but the result is the same... Commented Jul 21, 2014 at 14:52
  • @KathiravanG there's just one storyboard which contains all the ViewControllers, i've cleaned and run the project few times... :( Commented Jul 21, 2014 at 14:52
  • Have you tried to "Reset Content and Settings" and tried again? Commented Jul 21, 2014 at 15:07

4 Answers 4

1

Two questions:

  • Is this a universal app?
  • Does it have 2 StoryBoards?

Are you sure you are adding ViewController to both of the storyboards? It can be a silly mistake while you are adding VC to iPhone StoryBoard only and running iPad app or viceversa. 😝😝

Sign up to request clarification or add additional context in comments.

1 Comment

There's just 1 storyboard, and it's not an universal app, its an iphone app. :(
1

Well ladies and gentleman... I've removed the app from iPhone Simulator,I've cleaned project and built it again,all this before run it. IT WORKS.

To be honest... I don't understand anything.

Thank you so much for wasting your time in my post.

Comments

0

You mapping your view controller class to RecivedPushViewController. Try This

RecivedPushViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"recivedPushViewController"]; vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:vc animated:TRUE completion:NULL]; 

1 Comment

The result is exactly the same... :'(
0

Are you sure you're getting the right storyboard? Use:

 UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 

To get the main storyboard

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.