Xcode 4: Creating a UIView xib, not properly connecting

前端 未结 30 3433
时光说笑
时光说笑 2020-12-02 16:29

I\'m trying to create a nib that contains a view that will be embedded in a TableViewCell. I\'ve created the interface and implementation files, ResultCell.h an

相关标签:
30条回答
  • 2020-12-02 17:02

    I had the very same issue. And I tried :

    • Restarting Xcode
    • Deleting Derived Data
    • And many more

    None of that worked. What worked for me was simply to :

    • Remove 'suspect' class files from Project (just remove References, huh?)
    • Re-add them to the project

    And done!

    0 讨论(0)
  • 2020-12-02 17:02

    I had a similar problem with a project written in Swift.

    What worked for me was setting up the IBOutlet in code like this

    @IBOutlet var foo: UIView?
    

    and afterwards connect it to Interface Builder by dragging to the little circle that appeared right next to the code line.

    0 讨论(0)
  • 2020-12-02 17:04

    in XCode go to organizer, click project, click delete derived data... than clean the project

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

    I just had this problem and restarting Xcode did not fix it. I removed the class files from the project then added them back in and it started working.

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

    Hope this helps someone out there.

    I just had to delete the derived data folder. You need to click Window -> Organizer -> Projects -> Delete Derived Data

    AND RESTART XCODE.

    You should be good to go!

    0 讨论(0)
  • 2020-12-02 17:06

    This might be an old topic but just in case anyone has the same issue in future, try deleting the associated .xib,.h and .m files and create new ones. For me, the UIViewController in my .h file wasn't purple and even backspacing and typing it didn't help.

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