iOS - Storyboards - Link the same UITableViewController to 2 different UITabBarControllers - objective-c

I'm working on a navigation style iOS app using Xcode 4.3.2, SDK v5.1 and storyboards. The user can take several routes through the app but there is one particular table view scene that is used whichever route is taken. I therefore just want to have this scene defined once, but be visible as a tab page in more than 1 different tab bar controllers. The storyboard designer allows these relationships to be defined, but when the app is run the table view scene only appears as a tab button in the tab bar controller that it was most recently connected to.
Am I trying to achieve the impossible? I would have thought if storyboard lets me connect everything up then it should be achievable.
Many thanks,
Jonathan

Related

UINavBarController connecting the same UIViewController to multiple navigation controllers

I have a storyboarded app with a chain of tableviews followed by a detail view. Kind of the classic iPhone app. There are 4 tabs and each one leads to a navigation controller.
The issue is I really want to avoid unnecessary glue code since the app is basically finished. If it was possible to connect the Search and Favorites (bottom two off the tab bar) controller as 'Root View Controllers' to the same UIViewController I would be done. However, this won't work since a view controller can only be the root view controller to one tab. So as you can see I've instituted two dummy UIViewControllers that forward you to the UIViewController in the middle. Now, unfortunately, I have to write code to make that central view controller a fake root view controller to disable the appearance of the back button, and prevent popping to the blank root when you double-tap the tab bar.
Has anyone got a more elegant solution?
This appears to be a flaw in Storyboards. One workaround would be to use simple view controllers for each navigation controller's rootViewController. Put a UIContainerView in each that points to the UIViewController you want to share.

Tab Bar in UItableview

I have written an iPhone app with about 5-6 screens (each is a UITableView). I have finished writing the app, and now the requirement came up to add a tab bar in the 3rd screen.
Basically, the structure of the app is as follows:
Screen 1: Name of restaurants (example)
Screen 2: On clicking one restaurant, you get a number of options, like 1. location 2. rating 3. cuisine etc. Clicking each of these options shows a separate table view with some information.
Now, I need a Tab Bar in the 3rd level of screens (location,cuisine etc) with the same options.. i.e. location, cuisine etc, so that a user can directly go to that option instead of going to the previous screen first.
How can I implement this in my code? Each of the view is a subclass of UIViewController.
Thanks!
Drag in a UITabBarController from your Interface Builder. Connect as many ViewControllers as you want to your UITabBarController, and connect your 2nd View Controller to your UITabBarController.
NOTE:
If you are not comfortable with the UITabBarController connections, just start a new XCode project for "Tabbed Application" and consider it as a starting point to your app (for inits and connections)

How to replace the FirstViewController in a TabBar app with another view controller (Kal)?

I created an empty iPad TabBar application using XCode 4, without storyboards. I placed that app in a workspace. I then added the Kal source (obtained from the iPad Juice build) to the workspace as a separate project. The initial build was clean.
I then went to the Kal example (NativeKal) and added EventKitDataSource.h and .m, and NativeCalAppDelegate.h and .m. (The image below shows what files are in the example project)
This is the code from the NativeCalAppDelegate.h file:
I tried setting the first TabBar UIView controller to "KalViewController" as I would normally do when using Storyboards, but it isn't listed in the drop down list of classes.
The question is: how do I get the NativeCal example view controller to replace FirstViewController in the in my TabBar application?
Comments added as Answer.
My recommendation is to switch to storyboards it is a lot easier to do UITabBarControllers in them. You can do this by just creating a new storyboard and copy and paste everything into it and then control drag from the UITabBarController to the UIViewControllers that you want to be linked to the tab bar controller and it does the rest for you, everything else is the same after that. In storyboards you can set the first view controller to be loaded so if you need it to be KalController then you can set it when you set up the UITabBarController. You can also set this in the code. I found that storyboards were a great new feature to xcode, UITabBarCotrollers are a lot easier to do in them then in .nib files I could never get them to work.
Hope this has helped.

MonoTouch: StoryBoarding - manual segues?

iPhone/iPad dev newb here...
I am using MonoTouch to create a universal iPad/iPhone storyboard app. In the primary view controller (RootViewController) the default auto-generated behavior is a table with a single cell "Detail" in it, which hardwires you to the next destination (DetailViewController).
I'd like to change this RootViewController to instead show a login control I've made extending UIViewController (LoginView). I have had some success putting the LoginView inside the RootViewController, but can't figure out how to make it 'segue' to DetailViewController. And upon watching how the iPad app works, where there is no segue (that I can see) between the two, am I going about this wrong?
To summarize: How do I enhance this storyboard app with a preceding login screen, reusing its contents/xib between the iPad and iPhone variant?
Apologies if this is a bit unclear and muddled.......
I have not tried a storyboard app in Monotouch yet, but I did spend a lot of time working out the best approach for a login screen for my application. What I ended up doing, which could work in your situation as well, is presenting the login screen as a Modal view. Once the user has successfully logged in, we then push the next appropriate view.
So if you are automatically pushed into the detail view by the storyboard viewcontroller, you could display the login dialog as a modal dialog from the detail view's DidLoad or DidAppear methods.

IPhone Example : Login Page and then Navigate to another Screen (UI Table View)

I am an .Net Expert but a new to the IPhone App Development. Recently I have started workinf on Objective - c.
I need a help I need a example which shows a Login Screen and then Navigates to the another Screen (UITableView) when username and password and found correct.
As of now I am assuming that username and passwords are hardcoded in app.
I have tried to Design the Screen for Login UI but unable to Load the another ViewController but it wont worked
Can some one help me out with examples, Links?
You need to decide on a navigation paradigm for your app first. Normally in this case, you'd just use a UINavigationController and use the pushViewController method to push a new view into your app.
The UINavigationController acts as a stack of views onto which you can either push new views (in your case) or pop views. Other options you have are listed nicely here - http://flyosity.com/application-design/iphone-application-design-patterns.php
This could be of some help for the tableviewcontroller + UINavigationController - http://icodeblog.com/2008/08/03/iphone-programming-tutorial-transitioning-between-views/