search

Home  >  Q&A  >  body text

objective-c - The parent class controller inherited from the customization is not loaded using xib. What is the reason? It could be loaded before

[xib Create Controller]
1. When creating the controller, the parent controller selects a customized controller BaseVC, which inherits from UIViewController.
I checked Create xib, and then when I initialized the controller and pushed, I found that the view in the xib written by this control was not loaded.
My controller was created this way before, but suddenly it didn’t work again. Then I inherited this controller from UIViewController and it can be loaded.

Supplement: The method I use when initializing the controller is XXXVC *vc = [XXXVC new];

                             self.navigationxxx pushViewXXXXX
 我的父类控制器中没有重写 loadView方法。
我之前的控制器创建的方式和上面是一样的,继承的也是BaseVC,初始化后可以加载出来。可是今天突然不行了。想知道是什么原因。我啥都没改过勒
仅有的幸福仅有的幸福2883 days ago715

reply all(1)I'll reply

  • 为情所困

    为情所困2017-05-02 09:31:44

    // 重写初始化方法
    - (instancetype)init{
        if (self = [super initWithNibName:@"父类xib名称" bundle:nil]) {
            // 初始化
        }
        return self;
    }

    reply
    0
  • Cancelreply