Xcode 4: Creating a UIView xib, not properly connecting

前端 未结 30 3442
时光说笑
时光说笑 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 16:53

    I have had this problem and found a solution not listed above.

    In my case, I could see there was something wrong in the class .h file because my custom view controller did not recognise the class : UIViewController (it was in black not purple). All the other custom view controllers had the : UIViewController in purple.

    in my case, and possibly yours, I needed to add the class to targets/build phases/compile Sources drop down. The .m needs to be added. All of the other .m's were there but not this one.

    Once I added it, the :UIViewController appeared in purple and everything worked fine.

提交回复
热议问题