I'm having a glitch with a controller that inherits from a base class. My base looks like:
public abstract class BaseUIViewController : UIViewController
{
public BaseUIViewController() : base() { }
public BaseUIViewController(..) : base(..) { }
}
My controller inherits from this and defines a constructor like:
public class MyController : BaseUIViewController
{
public MyController(ISOmeService service, IOtherService service)
{
..
}
override ViewDidLoad(..) { .. }
}
TinyIOC creates the instance of the conntroller and supplies the constructor services. For some reason, ViewDidLoad runs before the constructor when I do this. When I remove the base class definition, it works with no issues.
Any idea why a base class causes the issues? I can logically assume it has to do with the objective-c compilation, but is there a workaround?
Thanks.
Don't touch the Controller's View property in the constructor as this will trigger ViewDidLoad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With