I created a Single View application with a view controller that allows you to enter homework assignment data. I now am trying to add onto this app by creating a navigation controller. I want the First Screen to be a Table View, that switches to the homework assignment screen when you click the "Add" arrow.
I've created the Navigation controller onto the Table view, and connected the Add button to the Assignment View Controller, but when I start the app, it still opens up to the Homework Assignment screen.
Can anyone provide a simple way to change the startup screen to my TableView?
EDIT: I am using storyboard. I havent added/edited any new code anywhere for the Table view/ Navigation controller/AppDelegate, I just dragged and connected with storyBoard, I just need to app to startup on the table View instead of the Homework assignment View Controller.
In your storyboard, select the view controller that should be the initial one. Go to the utilities view (on the right). Open the attributes inspector. Tick the Is Initial View Controller checkbox.
Related
I have a viewcontroller and a tab bar controller. I want to change view controller as initial view controller and create a segue to show tab bar controller.
I have tried to set the new initial view controller. There are 2 ways. First, check the tick box "Is Initial View Controller". Second, drag the arrow to new screen. It does not show any error, but it shows the tab bar controller as usual and I can't find the view controller either.
Anyone know how to what is going on. Please tell me to fix. Thanks
You need to use a UINavigationViewController and connect it up in the hierarchy in a similar fashion to:
The leftmost view is the "view" that you mention, which needs to show the UITabViewController.
I've added a button for ease of use.
The next along (send from the left) is the UINavigationViewController. No settings on here need to be set etc... it's pretty much "plug and play" as to put it.
The next view (third from the left) is the UITabViewController (with corresponding views to it's immediate right).
The connection between the UINavigationViewController and the UITabViewController is "rootViewController" as the Tab View is the "root view controller" e.g. the primary view controller.
The segue between the first view, and the navigation view controller is merely a "show" segue. I liked directly between the button and the navigation controller in Xcode.
Hope this mash-up helps!
Edit I wrote a quick mask up of what I posted in the images for you to play with: https://dl.dropboxusercontent.com/u/61211034/Stackoverflow/NavgationViewController.zip
Based on your storyboard's image, looks like you don't have any NavigationController embedded to your root LoginViewController, try this:
Select your LoginViewController on your storyboard
Then in xcode Menu bar at the top, go to Editor -> Embed in -> Navigation Controller (as you can see in the image below)
Then your NavigationController will be set as your Initial View Controller, and see your LoginViewController be displayed and work as expected your segue.
I am beginner in ios development. I created a tab bar controller in storyboard. In one of the tabs, I added a table view with custom cells in storyboard with a map view on top created in code. When user presses on the map view, it slides down pushing down the table view. All is fine except when I go to other tab and come back to the tab, the table view is back up with its frame from storyboard. Can some one suggest how to prevent this?
I have a UITabBarController. Now I want to add a view above it, and make the view unchanged when users switch to another tab. I've tried to create a UIViewController, and add the UITabBarController as a subview, but it crashed when I switched to another tab.
Is there any good way to do it? Thanks for any help.
Sure there is. What you'll want to do is make a view controller, which will house the view that is constantly visible, and add the tab bar controller on top of it. If you're using storyboards, this can be accomplished easily using a container view. Simply drag and drop a container from the object library onto the view controller you created, size it as you wish, and link its viewDidLoad segue to embed on the tab bar controller.
http://dl.dropbox.com/u/91385349/tabInView.zip
Good day everyone, currently I'm doing a simple project which uses the navigation controller default template.
Now I'm done with my current XIB (navigation template), I have created second XIB and I have added a navigation controller on it.
Let say:
It is a hierarchy table view, first the user choose one of the option available on the first table view, after that, will proceed to second XIB with another table view too.
My problem is, I have added one navigation button (Compose Email Item) on second XIB, but when I test run the program and reach second XIB, I couldn't see the button up there. Anyone know what happen?
Thanks.
As you said that you have added a navigation controller in your second .XIB
But for second .XIB there is no need to add navigation controller, you just add UiViewController.
And in viewWillAppear method of second controller add your navigation button
As you said you have added a navigation controller in second xib and added button on that. I think you have not done the connection in the second xib.
I want a single startup view with a button and a welcome screen. When the button is pressed I then want to navigate to a second view which contains a table view and toolbar.
I've tried creating a ViewController but my button is shown on all views. I just want a single view, then when it's pressed i go to the next view and the 'real' app starts. Can someone please try and explain the best architecture to do this?
(like in chapter 6 of beginning iPhone 3 Development by Dave Mark and Jeff LaMarche )
Thanks
Are u developing for the iphone or ipad, if its for the iphone then have u looked into UINavigationControllers? These allow you to interchange from view controller to view controller in an easy fashion.
So for your problem I would have 2 view controllers one for the startup and one for the table view view controller. Assuming you set up the Navigation controller right (which you can easily by starting a new project with a navigation based viewcontroller through xcode), then you can use [navigationController pushViewController:viewCOntroller) method to present your view controllers view, also viewcontrollers have their navigationController as a property, so when the button is clicked all you should have to do it
new up the viewcontroller whose view you want to display
and call (from the current view controller ) [self.navigationController pushViewController:] method to display your second view controller.
release the view controller u just pushed
Navigation Controllers also have a navigationBar property which you can use to go back and forth between view controllers.. heres the class reference and it contains a guide of how to use these..Navigation Controller Reference