3

I have deleted all of the original files (Main.storyboard and ViewController.M and ViewController.H) and I have created a new storyboard (I have my reasons) but when a run time error produces "Unknown class ViewController in Interface Builder file" I have tried deleting the Module text as shown elsewhere but still nothing.

Any suggestions?

mdavidson16
  • 43
  • 1
  • 5
  • 2
    Honestly if no-one ever did any coding until they had "read the documentation" then not only would they not understand the documentation (as it is almost always aimed at people of certain standard and written in jargon) but they would never get started. I came across this error following a simple walk-through. I hope you will remove your comment and remove your down vote. You do our community a disservice. – James Robinson Aug 12 '15 at 10:55

1 Answers1

7

Sometimes Xcode missed customModule="AppName" customModuleProvider="target"

To fix it, open storyboard as source code and replace this line:

<viewController storyboardIdentifier="StoryboardId" id="SomeID"   customClass="CustomClass"
sceneMemberID="viewController">

to this:

<viewController storyboardIdentifier="StoryboardId" id="SomeID" customClass="CustomClass"
 customModule="AppName" customModuleProvider="target" sceneMemberID="viewController">
iAnurag
  • 9,286
  • 3
  • 31
  • 48
  • 1
    This was useful. In my case, I had to open storyboard and specify a Storyboard ID in Identity Inspector. The root cause: I copy/pasted a collection view controller from a previous project's main.storyboard into a new project's main.storyboard. Although I assigned a cutom class to the view controller in my new project, looking at the storyboard's source code, it didn't seem xcode really assigned the custom class to the view controller. Specifying a value for storyboard ID did the trick for me. – Semere Taézaz Sium Jul 02 '15 at 16:29
  • 1
    I had not realised that the module needed to be set at all (it is not in the walkthrough I am following) adding it in the Identity inspector solved my problem. – James Robinson Aug 12 '15 at 10:57