StrangeIOC: 在Start中初始化上下文报错MediationException: A view was added with no context. Views must be ad...

    void Start () {
        this.context = new Demo1ContextView (this);
    }

在Start中初始化上下文报错
MediationException: A view was added with no context. Views must be added into the hierarchy of their ContextView lest all hell break loose.
Solved Way
MediationException: A view was added with no context. - Solved by adding the context in Awake and not Start.

    void Awake () {
        this.context = new Demo1ContextView (this);
    }

你可能感兴趣的:(StrangeIOC: 在Start中初始化上下文报错MediationException: A view was added with no context. Views must be ad...)