user3712524
user3712524

Reputation: 101

Segue identifier error

I have another question about Xcode. I am really new to this stuff, so please bear with me. My segues are working fine in the simulator but I have a warning with the yellow triangle exclamation point sign next to it that says:

    file:///Users/gavlabfhwa3/Desktop/BlindPed/BlindPed/Base.lproj/Main_iPhone.storyboard: 
warning: Unsupported Configuration: Segues initiated directly from view controllers must 
have an identifier for use with -[UIViewController performSegueWithIdentifier:sender:]

How important is it that I fix things like this? Is it going to affect my actual app? How would I fix this?

Thanks in advance. My code is posted in the last question I asked and, if necessary, I can repost it or post this question in answer to my other question. My code doesn't have anything in it about a segue, I am doing all the segues with storyboard.

-Jeff-

Upvotes: 0

Views: 3414

Answers (2)

Lucas van Dongen
Lucas van Dongen

Reputation: 9858

OK this is something you should need to set in Interface Builder. Open up the story board and find the lines between your scenes. Click on the one you suspect to cause the error:

enter image description here

On the attributes inspector you should specify a string like I did ("toSection") that makes sense to your application. Storyboard segues without Identifier will work fine if you link them directly from IB but not when you programmatically try to call them.

I would really like to stress the fact that your app should be as warning free as possible and you fix them as soon as they appear. Lots of warnings will bite you sooner or later.

Upvotes: 4

Uxonith
Uxonith

Reputation: 1622

If your segue doesn't have an identifier it won't hurt anything, but it's not going to be able to be used. Adding a segue from a ViewController allows it to be called from:

[self performSegueWithIdentifier:(NSString *) sender:(id)]

You do this so that you can programmatically call the segue instead of it being attached to a button or something.

Upvotes: 1

Related Questions