This issue is quite simple to reproduce. And I think this may be a bug in watchKit.
If I display View with:
[self presentControllerWithName:#"OneButtonView" context:nil];
It works great.
If I use this view for one button, and open exact same view with that button, new modal view comes on top of original (as expected). If I click title - top most view gets closed and I see parent view. In this way I can create 10 pages and go back one by one to the very first one. Everything is great.
Issue exists only if you try presenting one/more modal views by using this method:
[self presentControllerWithNames:#[#"OneButtonView"] contexts:nil];
If I do that, new view is presented on top (as expected), I can close it by pressing the title (as expected) but title/titles for all pages that were created with presentControllerWithNames: disappear as soon as you come back from child modal view. This behaves identical for one or multiple views presented this way.
I tried setting title explicitly for one/all views presented this way but it didn't help.
Anyone encountered this or have any solution for this?
Related
This problem has been plaguing me for a week.
I have a UISplitviewController where both panels are always visible. In the master view, I have a list of calendar events, and when I select one, it loads the event into the detail view. I can edit the event fine, (the EKEditEventViewController is presented in the current context, showing up in front of the detail view only) but in iOS8, when you click the location cell, a new view controller is presented and searches for addresses that you type in. My problem comes when I dismiss this location selection view controller. When dismissed, the EKEditEventViewController behind it fills the whole screen (it appears partly behind the master view in the split view controller). When rotated, everything goes back to the way it should be.
Any idea why this is happening? Any help is greatly appreciated! Thank you
I had a similar problem:
eventViewController.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
did it for me, but this is what you've already done, as far I undestood.
Maybe putting the EKEventViewController in a UINavigationController smoothes out some other things, and setting there the current context could help.
i have implemented a tabbarcontroller with 5 tabs each connected to a view.
the tabBarcontroller is created and default view allocation happens in another view.
everythine looks fine but i have a bug.
each view in the tab have buttons that trigger other views. these views don't have tabs so to get back to a tab view i use a back button.
when i press the back button i don't want the view ( with the tab ) to be created from scratch. so i have put the relevant code in viewdidload rather than viewwillappear.
( this choice is because this view downloads data from server and it becomes time consuming to put the code at this point in viewwillappear )
However if i am returning from current tab to a tab that i had previously touched and viewed. I want view to be loaded from scratch because data should be downloaded again at this point. but since i am using viewdidload rather than viewwillappear the old view is not refreshed.
how can i achieve this conditional refreshing of view depending upon whether i am coming from another tab or a from a view with back button
One way to do this is the isMovingToParentViewController method in your view controller. This will enable you to detect if your current stack has been popped from navigation controller.
There's an answer here that explains how to use it, and links to Apple's documentation.
As you can see from that thread, you can also use NSNotificationCenter to do this.
I'm not sure when or how this happened in my project, but it did. The main button in the middle of my initial view controller ignores all touch events when I first load the app. The buttons in my navbar on the bottom all work fine.
If I follow one of those buttons through a modal segue to another view controller and then segue back into the initial view controller, the button works perfectly.
I'm at a loss. Any idea how this could have occurred or how I could fix it?
Update
I can't put my finger on what, but this has something to do with my constraints. If I remove them (and my app tumbles into a mess on 3.5 inch phones), the button works at all times.
I have the same problem: on the first load of the view one particular UIButton doesn't work, but if I tap on other tab bar element, launching a segue and then coming back to my home screen, it works perfectly.
My problem persists even if I remove every constraints for the view.
In my case, the POSITION of the button seems to be the cause of the issue: in the right side of the view it becomes not working, but if I move the same button on the center or left of my view it becomes available.
HELP ME/US :-(
I am writing an iPhone application using the storyboards for an initial mockup. The problem I have right now is switching view controllers.
I have a table view controller and another view controller. All I want to do is use a back button to go back to the original screen, and I can do that, except the data disappears. The storyboard that I have is shown below.
I have the Back button going back to the original navigation controller. I have also had it going back to the Card view controller.
I have hard coded some example cells to just see how things look and they show up just fine when I run the simulation. When I click the back button though, it goes back to the All Cards screen and the cells that were there are now gone.
If I need to post some code just ask for what part would be helpful, I have done all of this through storyboards though.
I'm sure it's something stupid I've done, any point in the right direction would be greatly appreciated.
Basically: you pushed where you should have popped.
What you are seeing on the Storyboard does not exist yet. By segue-waying during runtime to a view controller it gets instantiated.
When you segue-wayed during runtime from the Add Card view controller "back" to the Card View Controller - here is what happened: instead of popping the navigation stack all the way back to the Card View Controller you already had, you just instantiated a new Card View Controller and pushed it onto the navigation stack. You could verify that by going all the way back to the original Card View Controller by tapping the back button several times.
What you could do to accomplish your task is this:
Instead of using the Storyboard for your back button use an IBAction in code:
- (IBAction)popToRoot:(id)sender {
[self.navigationController popToRootViewControllerAnimated:YES];
}
I have two xibs, one is my title screen with buttons, the other is a more specific window that should come up when one of the buttons is pressed.
This isn't switching the whole screen, just a popup window, where clicking outside of the bounds of that window will make it disappear leaving only my title screen remaining as it was visible behind this popup view. This is similar to my understanding of "modal views".
Anyway I do not quite get how to connect it to the button on my title screen. I have the views made in IB ready to go. I'm not sure if I have declared all objects to satisfaction yet.
From what I understand I think I need a UIViewController or something, but its all a pretty thick fog of information right now
insight appreciated, or links to proper noob sources would be helpful
Does your title screen have a view controller (or is your app delegate the main controller object)? You will want to add an IBAction to that object, connect the button to it, and then present your other view controller modally (or in a popover) from there.
A popover will appear in a small window with an arrow, and tapping outside will close it. A modal view controller typically slides up into place, and you have to press a cancel button to close it. This guide explains how to use a popover. Using a modal view controller is simple if you have a view controller: [myViewController presentModalViewController:nextViewController animated:YES].