Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9189517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:15:17+00:00 2026-06-17T20:15:17+00:00

I have a tabbar application using storyboards. Tab 1 is a UIViewController with Mapview

  • 0

I have a tabbar application using storyboards. Tab 1 is a UIViewController with Mapview & Tab 2 is a UITableViewController.

The appdelegate calls for a web fetch (via a custom class) and takes that web response and pareses it (via a custom class) and then puts the info in a CD-db (via a custom class).

MapVC fetches results from the CD-db and populates an NSMutableArray (property) to be looped thru. The array contains a custom CD-db object with 2 coordinates which are used to create an MKAnnotation in the for loop. The distance from each MKAnnotation to userLocation is calculated and the MyLocation Class object is completed with a distance value in its subtitle property. Thus each pin on the map displays a title (name) & subtitle (distance).

TableVC creates a separate fetch to the CD-db and populates its array property to be used in the cellForRowAtIndexPath (CFRAIP).

Now I want the tableview to also display the distance in each cell. So it has been suggested I subclass the uitabbarcontroller and set the delegate/datasource of the TableVC.tableview to the MapVC. My question is, how do I subclass my uitabbarcontroller and set the delegate and datasource?

Something like: in app delegate get the window’s rootviewcontroller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:15:19+00:00Added an answer on June 17, 2026 at 8:15 pm

    First you need to subclass UITabBarController. Make a new file in Xcode, set UITabBarController as the parent class.

    Then go to your storyboard and select the tabbarcontroller, set its custom class to the class you just make.

    In viewDidLoad of the tabVC get its sub VC’s and find the ones you want. Here’s the pseudo code, I can tidy it up later:

    CSMapListViewController *mapListViewController;
    CSTableViewController *tableViewController;
    
    for (UIViewController *vc in self.viewControllers)
    {
        if ([vc isKindOfClass:[CSMapListViewController class]])
        {
            mapListViewController = (CSMapListViewController *)vc;
        } else if ([vc isKindOfClass:[CSTableViewController class]])
        {
            tableViewController = (CSTableViewController *)vc;
        } 
    }
    
    tableViewController.tableview.datasource = mapListViewController;
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iOS 5 Tabbed Application, using Storyboards. My Tabbar Controller points to
I have a tabbar application with each tab directing user to a UITableViewController. I
I have a tabbar application. And the item of first tab is Navigation Controller.
I have created a custom tabbar in my application (using TabHost and TabWidget ).
Using storyboards you have no easy access to the first view controller in appDelegate
I have an application that has many views (Using tab bar controller). I want
I have used tabbar controller using storyboard in application with iOS 6. In normal
In my application I have a Tabbar and I am using ActivityGroup to load
I have used tabbar with activity group in my application. I have four tab
in my application i have to make settings button in tabbar .so using this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.