Application crashes with TargetInvocationException when entering view for second time - xamarin

Whenever i enter any of my apps views for first time, everything is working as expected. Problems occur when i navigate back to previous view with androids built in back button.
As for example, lets imagine i have view X and Y.
View X is loaded on app start with no problem.
Click button which navigates me to view Y.
Click Android back button which navigates me back to view X.
Clicking the same button crashes the application.
In my case view X coresponds to "ReservationViewModel" and Y to "ReservationDetailsViewModel", but the issue occurs in all of my views
When the exception gets thrown, output console contains several logs:
2021-06-19 02:09:04 [TRACE] (MvxForms) PresentationAttribute not found for ReservationDetailsViewModel. Assuming ContentPage presentation
2021-06-19 02:09:04 [TRACE] (MvvmCross.Logging.MvxLog) No view model association found for candidate view StartActivity
**System.Reflection.TargetInvocationException:** 'Exception has been thrown by the target of an invocation.'
2021-06-19 02:09:04 [TRACE] (MvvmCross.Logging.MvxLog) No view model association found for candidate view StartActivity
Interesting enough, everything is fine if i would navigate back from view Y to view X with IMvxNavigationService. The problem occurs only with the back button

Related

Cocoa: How to dismiss multiple modal window / Modal View Controllers at once?

I have a situation that one window present modal view controller and then user can tap to open new modal controller and it can go on. Each model controller have a button to dismiss and requirement is that it should come back to the first view controller which was presenting them.
For eg A presents B present C presents D. Now when user will press dismiss in D then it should come to A.
What is happening if I do this all view controller dismisses but Modal session stays there i.e app become unresponsive as if model window is still there.

Why is my view loading but not displaying with segue?

I have a bunch of views (5) and a navigation controller the user can go through by pressing buttons that segue to the next view (each view has something the user does and sends data to the next one). My app is connected with a Firebase database, so I'm doing some stuff with that.
Anyway, the view I can't get to work is a TableViewController which works as a checklist, the user must select a certain number of cells, then clicks next and an array is sent through the prepareForSegue to the next view and this view should be display. It isn't. I have some code and some prints in the viewDidLoad that let met know that the view is supposedly loading, just not being displayed.
The screen freezes and the button just remains pressed. It doesn't crash, just stops.
My code has nothing special. It just has a performSegue in the first view and nothing really in the second one.
This is the way they're set up:
https://imgur.com/a/cyO47Pl
I've been told the problem is that there are too many push segues or something like that, could it be?

xcode 7.3.1 not show controller in debug view hierarchy

I want to inspect drawing of the views, I press debug view hierarchy, but the screen is empty
More precisely, doesn't show only one controller, that is the screen with one controller, other controllers normally draws. It is CollectionViewController and if in a code to put quantity of cells 0, then the controller is displayed in full

Force view to reload when user presses "Menu" button on new Apple TV remote

When a user presses the "Menu" button on the new Apple TV remote it takes them back to the previous view. This is fine but it doesn't appear to reload the view. Right now I have a view with my game and a second view with the score card. When the user finishes the game they are taken to the score card view. The problem is: if they press the menu button on the remote they are taken back to the game view and it doesn't reload. Can this be fixed?
- (void)viewDidLoad is only called at object creation, when you are going back to a view controller, it is not created again (unless it has been deallocated due to lack of RAM) so you have to handle all your dynamic actions (like refreshing content of the view) by using the
- (void)viewWillAppear:(BOOL)animated
or
- (void)viewDidAppear:(BOOL)animated
methods !

SplitView Ipad - Segue to Detail View keeps opening views

I have an app with a SplitViewController.
On the MasterDetail I have that whenever you push a cell, it performs a push segue to load a new view in the Detail View.
The problem is, if I press the cell 10 times, it opens ten times the detail view and I have to click the Back Button 10 times to go where I started.
How can I solve this??

Resources