Here are the steps I've followed - pretty much this: http://www.youtube.com/watch?v=cFNtD098Bbk&feature=player_embedded
Create new Tab Bar Application
Looking at MainWindow.xib I drag a UIViewController in
Drag one of the tabs View Controllers onto the UIViewController
Set up buttons and actions top push the new view
Note I have no idea how he did the last step in the video, dragging one tab object onto another won't work for me
The navigation works fine, the new view gets pushed and all that jazz. But when I go to the tab that has the navigation controller it has two navigationBar's.
I can't find where to get rid of this for the life of me. It must be something really simple but I've been searching for way too long.
None of the many tutorials I've found have this problem, not does the project files of those tutorials even though my project looks pretty much the same as theirs in IB.
Does anyone know how I can get rid of the useless navigation bar?
I'm using Xcode version 4.0.1
Not sure how I missed it but the answer was stupidly simple.
Just needed to delete the UIToolbar from the nib file, can't believe I didn't find that earlier.
Related
I have been using the storyboard to make an application and currently there are many segues and several components. This is causing a ton of lag when I try to do anything inside the storyboard. Is there a way to hide components inside the storyboard? thanks.
+1, For the potentially features to improve Xcode. Now, there is no way you can hide those views (Not that I know). But I would suggest you to,
Hide the debug areas you don't need.
Hide the document outline while working with segues.
Why?
I think in this way whenever you are making changes, system does not have to repaint those unwanted views and long document outline. Probably this will be less laggy(I don't think there is a word like this)!
Work around
Divide your segue into different meta segues and then you can call those segues from your main segue. In that way you don't have to put each connection on one file but you condense it!
And here we go the documentation for it! Now you can get the story board by different file and then initiate with the UIViewController easily. Then you can just use old ways to segue between different ViewControllers.
Apple Documentation for UIStoryboard
Demo App.
In order to achieve this, I have made a quick demo application which will help any future visitors.
https://github.com/Krutarth/LargeStoryboardManagement
Visually something like this,
You can split one huge storyboard into multiple small storyboards.
Select the view controllers that you want to move to a smaller storyboard, then
In the top menu, click Editor -> Refactor to Storyboard
Save the new storyboard with the desired name. XCode will auto generate all the required storyboard links from your large storyboard to this newly created small one.
I thought this is quite simple but I can't seem to find the answer. I have a view controller with 3 buttons, one of these buttons has a push segue to a tab bar controller. When pressed I presume it loads the '0th' tab item which is the fine for the first button but how do I then get the other two buttons to push segue to the other two tabs?
I have read a lot of articles but none of them seem to have the answer that I'm looking for. I already have the tab bar controller and all the sub-views created in the storyboard, I just can't seem to get an instance of the UITabBarController.
I have 2 logical ways of doing it in my mind but I am quite new to objective-c and can't work either of them out for the life of me.
The first is to programmatically load the uitabcontroller and set which item I'd like to load but I can't seem to find a way of invoking an already existing tab bar controller. Something like this (I know it loads a random view which is not what I exactly want):
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:view1ViewController];
My other idea was to either override / hijack the segue or the load event of the tab bar controller and find out who called the segue and then if they are one of my other buttons and then switch to the relevant tab item using:
[myTabBarController setSelectedIndex:index]
I just can't seem to put it all together. I suspect the latter idea requires app delegates which I don't quite understand yet.
I apologise for this in advance - I realise that I'm in completely way over my head! (btw... I have moderate PHP and C# OOP experience so I understand 'some' things.)
I have been learning iOS development for a few days now. At this moment, I have questions over how the rootViewController is to be used. I searched the web for 3 hours yesterday looking for the answer which turned up quite a few results that never really answered my question.
I am trying to learn to program an app using code only (no storyboards/xib files). I currently am trying to understand how to properly switch between views without using the UINavigationController. In my project I have the main delegate which creates the window, initializes my main view controller (which loads the separate view as well) and adds it as the rootViewController.
My first view has a button which calls a function in its controller to switch to my next view. Here is where my question arises: Do I switch the main rootViewController to the next view or do I load the next view as a subview of the rootViewController? Is the rootViewController supposed to encase all the views for an application? (I think this is how the UINavigationController works)
I have gotten switching of the rootViewController to work in my app, but I want to make sure there isn't some other way I am suppose to manage my views.
I would not switch the rootViewController, I think that should remain stable. So you could add it as a subview, or you can present it as a modal view.
And of course, you can just change the rootViewController to point to your new view if that's how you want to do it.
Hey,
my starting point was this
MultipleDetailViews sample code found on xcode.
I am trying to create a separate navigation stack for the First- and SecondDetailViewController in order to push new view controllers.
A great help was this tutorial but I still couldn't manage to include the navigation stacks.
I have been stuck on this problem for a while and wonder if there exists a simple solution...
Thanks in advance for any suggestions.
In the sample code, try to open the MainWindow.xib (en) and remove the 'FirstDetailViewController', replace it with a NavigationController, add the rootViewController for this new detail NavigationController and you are good to go.
I guess that you know what to do next. Hope it helps.
looking at this believe i had exactly the same problem and never found a way around it, until a couple of days when i was watching an unrelated lecture off of iTunes U, anyway in the new view controller that you load, have you implemented the UISplitViewControllerDelegate, (if this doesn't work have you tried moving the UISplitViewControllerDelegate to the master controller)?
So I have programatically created a tabbarcontroller that uses navigation controllers(based on Jeff Fithian's example). Now I need to push an additional page onto the navbarcontroller (ie I have clicked on an item on the list) but I can't quite figured out how to get a reference to the navigation controller of the current view from it's view controller.
I went with the programmatic approach, because it was the only way to start out the project that worked, but now I am getting really bogged down.
Any ideas?
I am sure there is a tutorial somewhere that addresses this, but after four days of looking (I am in the middle of the MidAtlantic "snow" emergency) I have found nothing...
You can find the navigation controller from the view controller with the .navigationController property.
[my_view_ctrler.navigationController pushViewController:other_view_ctrler animated:YES];