Loading ViewController from xib file

前端 未结 10 2395
我在风中等你
我在风中等你 2020-12-08 02:33

I had a MyViewController.swift and a MyViewController.xib presenting the layout of MyViewController.

I tried different methods to load this

10条回答
  •  春和景丽
    2020-12-08 02:39

    The problem is not with the methods...you have probably kept an outlet(XXX) connected for some uielement and have removed it from corresponding controller...I am adding example below...

    the above button is connected to controller now but when i comment outlet

    my app crashes

    so try to find outlet(xxx) that is missing from viewcontroller but is in xib file.Hope it helps :)

提交回复
热议问题