Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
During runtime loadView and viewDidLoad are called before UITabBarController's constructor. This causes issues with wanting code that isn't re-run every time a view comes into view (right now the alternative is to throw the code into a *appear member).
Do you have a test case that shows this?
I suspect the problem is that the constructor that is being called is a different constructor than the one you provided.
I just ran into this problem as well. Here is a distilled sample that reproduces the problem.
Since the base UITabBarController..ctor is calling ViewDidLoad directly, the inheriting class' constructor code is never reached. In my real-world case, this means I cannot inject any dependencies into my custom TabBarController's constructor because they will all be null when ViewDidLoad executes.
The native UITabBarController calls ViewDidLoad in its init method:
#23 0x00228ef8 in FailingTabBarController:ViewDidLoad ()
#24 0x0235192a in -[UITabBarController initWithNibName:bundle:] ()
#25 0x02338cf1 in -[UIViewController init] ()
I'm not sure we can actually do something about this.
I am having the same issue. I am trying to pass a note class into the constructor as a dependency, but this is never touched when stepping through the code. Any suggestions?
Hi All, using the "view will appear" method solved the problem for me.
public override void ViewWillAppear (bool animated)
//Utilize my dependency injection here
This usually happens when in a base class you call a virtual property, which ends up calling a virtual member on the derived class.
This is easy to see if you get a stack trace in the virtual method (such as ViewDidLoad) in the derived class, in which case you'll easily see what's happening.