Xcode 7.1 Swift 2 Unknown class in Interface Builder file

前端 未结 8 1150
一个人的身影
一个人的身影 2020-12-05 01:33

I\'ve created new Cocoa Touch File. Named it SwipingViewController. \"enter

Then try t

相关标签:
8条回答
  • 2020-12-05 02:06

    I solved it by manually writing the module name in the storyboard, under the class name. In my case it was the same name as the class, but it may differ.

    0 讨论(0)
  • 2020-12-05 02:10

    i had a similar issue as well. I had a ViewController with a TableView in it, and the tableView's custom class was called 'ViewController'. I just deleted the custom class for the tableView and the error went away.

    0 讨论(0)
  • 2020-12-05 02:13

    Still seeing this problem with XCode 8.2.1, but I am able to fix the problem by modify these in the storyboard xml file:

    1. Delete customModuleProvider="target" in the viewController tag:

      - <viewController ... customModule="Flights" customModuleProvider="target" sceneMemberID="viewController">
      + <viewController ... customModule="Flights" sceneMemberID="viewController">
      
    2. Delete customModule="Flights" customModuleProvider="target" in the widget tag (in my case, a label tag):

      - <label ... translatesAutoresizingMaskIntoConstraints="NO" id="PzF-6K-Hpi" customClass="YZLabel" customModule="Flights" customModuleProvider="target">
      + <label ... translatesAutoresizingMaskIntoConstraints="NO" id="PzF-6K-Hpi" customClass="YZLabel">
      

    I find that step 1 is very important too to resolve the crash/warning and cannot be skipped.

    0 讨论(0)
  • 2020-12-05 02:14

    For me: for table view cell in 'Indentity Inspector' unchecked 'Inherit Module From Target' and cleaned the project. It solved the problem and project run successfully

    0 讨论(0)
  • 2020-12-05 02:15

    For me the problem was that the class was not part of the Target Membership. Just add the class to the target, and you should see it back on the interface builder.

    0 讨论(0)
  • 2020-12-05 02:21

    In storyboard below the Custom Class field the module is set to None. Change that to your app module or just remove and enter class again, it should set to default like this:

    0 讨论(0)
提交回复
热议问题