4

I have a problem that I've been sitting with all the day. I have a super view which contains UIPageControl and UIScrollView, in this super view. I have created a sub view which contains three images, three labels, and three buttons. Each button has a touch up event. When the button event is triggered the super view will be promoted by a new view. For doing that, I created a segue which connected with super view and new view. Here is the connection code in the super view.

`                    
<connections>
    <outlet property="pageControl" destination="ivy-0Q-UQo" id="rGm-sh-mdE"/>
    <outlet property="scrollView" destination="4Yu-Qb-kbF" id="aqY-ou-cv4"/>
    <segue destination="zZo-CH-P2Y" kind="push" id="xBU-ZO-u7s"/>
</connections>

`

This piece of code will guarantee the connection between the super view and the new view is okay, here is the touch up event code.

WelcomeFrameViewController *welcomeFrameVC = [WelcomeFrameViewController alloc];  //super view instance
NSLog(@"=======================");
[welcomeFrameVC performSegueWithIdentifier: @"ForwardToLogin" sender: self];

When I run the program, the compiler complains with

2012-08-20 10:17:02.325 TTRen[2440:f803] ============44===========

2012-08-20 10:17:02.352 TTRen[2440:f803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver WelcomeFrameViewController: 0x688e960 has no segue with identifier 'ForwardToLogin''

I am quite new in iOS, any suggestions will be deeply appreciated.

Copas
  • 5,921
  • 5
  • 29
  • 43
leffe
  • 41
  • 1
  • 2
  • one trap is: if you're using say a split view controller. you may have the segway belonging to THE CONTAINED VIEW rather than actually the (say) split view controller. note that (very confusingly) it will however work perfectly if you make a segway on the storyboard from that child contained view, to some destination. but you won't be able to find that named one - it must be on the split VC, not on the child of the split VC. – Fattie Mar 30 '14 at 09:41

2 Answers2

0

'Receiver WelcomeFrameViewController: 0x688e960 has no segue with identifier 'ForwardToLogin''

In your storyboard, check that you actually have a segue named "ForwardToLogin"

spring
  • 18,009
  • 15
  • 80
  • 160
  • 1
    thanks skinnyTOD, i have created the segua and identified as ForwardToLogin, tha complain does not go away.... – leffe Aug 18 '12 at 06:00
  • I'm having the same problem and it's driving me nuts. I had 2 view controllers, connected by a segue called `login`. I add a 3rd VC in between, delete `login` segue from the story board and recreate it by dragging from 1st VC to the new VC and entering `login` in the Attributes inspector. That works fine but when I add another segue from the new VC to 2nd VC I get the error. – Robert Nov 07 '12 at 11:24
  • You named it **exactly** the same as you are calling it in your code (case sensitive, etc.)? If so then no idea. – spring Nov 07 '12 at 15:13
0

There does seem to be a bug with xCode (still in 6) where storyboard changes you make aren't get copied to the simulator. You can reset the Simulator's Content & Settings to resolve this.

Other things to check:

  • Check the naming of your segue. Check it again. Check it some more :-)
  • Ensure that your segue is pointing in the right direction. It needs to point away from the UIViewController that calls performSegue….
  • Ensure you don't have two copies of your view controller on top of each other, with the segue attached to the one on top, and you instantiating the one underneath!

There's a similar question here and I encountered the same problem too. The reset fixed it for me.

Community
  • 1
  • 1
Benjohn
  • 13,228
  • 9
  • 65
  • 127