0

So what I am trying to do here is press a button and it will switch to the next view controller, but the program crashes after I press the button and shows:

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));Thread      1, Queue : com.apple.main-thread

I use segue as push.

When I use segue as modal it doesn't crash.

I did some research online saying "make sure I don't have duplicate relationships"

Is the problem cause by the same name?

I started programming with C# and I know that every control has an ID name, but Xcode doesn't seem to have the ID name.

The two pictures are the relationships of two view controller and one of them is the page that it pops up after the app crashes.

image1

image2

image3

picciano
  • 22,341
  • 9
  • 69
  • 82
Rain
  • 231
  • 3
  • 12
  • 1
    Go into breakpoints (Upper left corner, just above your files, looks like a right arrow), press the plus in the lower left corner, select Exception Breakpoint and add it, then re run the app. Should give you a better idea of what's going wrong. – Rick Dec 15 '14 at 21:58
  • Yes, I did see the errors, thank you. But would you be able to solve it for me please? I searched online and couldn't find solution for that. The errors are Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:. and Segues initiated directly from view controllers must have an identifier for use with -[UIViewController performSegueWithIdentifier:sender:] – Rain Dec 15 '14 at 22:07
  • You seem to have 2 arrows coming from the navigation controller to its initial controller. What are those (I'm assuming that the controller all the way to the left is a navigation controller)? – rdelmar Dec 15 '14 at 22:08
  • 1
    possible duplicate of [Xcode: "Scene is unreachable due to lack of entry points" but can't find it](http://stackoverflow.com/questions/13531035/xcode-scene-is-unreachable-due-to-lack-of-entry-points-but-cant-find-it) – Rick Dec 15 '14 at 22:12
  • As Rick mentioned you have the entry point set to the first UIViewController as the arrow points to it. It should be set to the UINavigationController before it. Just move the arrow back to it. – Yan Dec 16 '14 at 01:28

1 Answers1

0

Select your UINavigationController from the storyboard and from the right side menu, as seen in the picture below, tick the is Initial View Controller button. Then try to run your app again and tell if it works. Good Luck

is_initial_viewcontroller

Now choose your UINavigationController and as seen from the picture below, drag the circle from root view controller and drop it in your FirstViewController and try to run again:)

root_view_controller

aytunch
  • 1,326
  • 1
  • 16
  • 31