Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two view controllers have the same storyboard identifier

As the title suggests I am getting the error that two view controllers have the same identifier but the problem is, they don't! I have checked through all my storyboards multiple times and never saw any with the identifier! The full error is

Two view controllers have the same storyboard identifier "IAC".

Not only that, but there are no storyboards with the identifier "IAC". Its possible I may have named one that a long time ago but their certainly aren't any now. I also just updated Xcode to the ios 7.1 SDK and it's possible that's part of the error. Does anyone know why?

like image 967
ZB-dev Avatar asked Mar 23 '14 18:03

ZB-dev


People also ask

What is identifier in your story for storyboard?

A storyboard ID does exactly what the name implies: it identifies. Just that it identifies a view controller in a storyboard file. It is how the storyboard knows which view controller is which. Now, don't be confused by the name.

How do I set the identifier for view controller in storyboard?

Step 1: Set a Storyboard IDIn the Storyboard, select the view controller that you want to instantiate in code. Make sure the yellow circle is highlighted, and click on the Identity Inspector. Set the custom class as well as the field called "Storyboard ID". You can use the class name as the Storyboard ID.

What is a view controller in Swift?

A view controller manages a single root view, which may itself contain any number of subviews. User interactions with that view hierarchy are handled by your view controller, which coordinates with other objects of your app as needed. Every app has at least one view controller whose content fills the main window.


2 Answers

In that case, press Command + Shift + F and then type the identifier that is being mentioned in the Warning / Error area.

Here after you search there will be list of matches, in that select Storyboard icons, and your answer lies there.

like image 178
Muhammad Waqas Avatar answered Sep 22 '22 17:09

Muhammad Waqas


remove derive data from Xcode -> Prefrences -> Locations -> DerivedData and rerun the project

like image 33
codester Avatar answered Sep 20 '22 17:09

codester