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

  • Home
  • SEARCH
  • 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 4253538
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:57:33+00:00 2026-05-21T04:57:33+00:00

Since I am a newbie in iPhone development, I need some advice on how

  • 0

Since I am a newbie in iPhone development, I need some advice on how to structure my xib file in order to get the following (essentially, it should be very similar to Google Places app).

I need a NavigationController with:

  • Map with search functionality.
  • TableView with search functionality (ideally, the search should be shared between map and TableView).
  • One view to show details of a selected item, whatever the source view is (map or table).
  • Map view should have a button to show listing view, and viceversa.

My doubt is, what do I have to nest where? I have a NavigationController with its View Controller set to another class with its own xib, but I don’t know how to go on.

Should I create a View with a search bar and another SubView to switch between Map and Table? Or is it better to have two full views each one with its own search bar?

EDIT 1

Finally I have decided to implement the following structure:

   - TabBarController
       - LugaresNavController (UINavigationController)
           - LugaresViewController (UIViewController)
               - UISearch 
               - SubView (UIView)
               - MapViewController (UIViewController)
               - TableViewController (UITableViewController)

MapViewController and TableViewController have their own xib files. What I want is to have the ability to switch between them into SubView, but I am not able to do it.

I have assigned MapViewController and TableViewController file’s owner to their respective class in the xib files, and also have specified which xib to load at the attributes of their representation in the xib corresponding to LugaresViewController, which is their parent.

When I run the application, all I can see is the TabBar with the NavBar and the UISearch. The frame where SubView should render either the map or the table is showing blank…

What am I doing wrong here?

  • 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-05-21T04:57:33+00:00Added an answer on May 21, 2026 at 4:57 am

    Your fundamental problem is that you are getting your different parent-child hierarchies confused.

    To recap: MVC is Model, View and Controller.

    iOS has TWO different parent-child hierarchies: One for the controllers and one for the views.

    The following are part of the controller parent-child hierarchy:

    - TabBarController
        - LugaresNavController (UINavigationController)
            - LugaresViewController (UIViewController)
    

    This means that LugaresViewController.parentViewController should be LugaresNavController and so on.

    However the following doesn’t make any sense:

    - SubView (UIView)
        - MapViewController (UIViewController)
        - TableViewController (UITableViewController)
    

    Views can have subviews but views can’t have subviewcontrollers,

    Are you doing the following?

    - SubView (UIView)
        - MapViewController.view (UIViewController s view is a subview of Subview)
        - TableViewController.view (UITableViewController s view is a subview of Subview)
    

    This is a view parent-child hierarchy. This means that:

    1. SubView has two subviews (MapViewController.view and TableViewController.view)
    2. MapViewController.parentViewController is nil.
    3. MapViewController.navigationController is nil.

    you can use view transtions to switch between MapViewController.view & TableViewController.view but not viewController transitions (such as presentModal… or push or pop ViewController…).

    If this is what you want, then you just have to make sure that you do:

    [SubView addSubview: MapViewController.view];
    [SubView addSubview: TableViewController.view];
    

    Incidentally, SubView is a terrible name. Usually we call those containerView or something like that.
    subview is such an important concept you want to be able to diffrentiate the concept of a subview from the instance of that view. It’s like naming your child “Kid” or your dog “Puppy”.

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

Sidebar

Related Questions

I'm a newbie to iphone development and I've been struggling with an EXC_BAD_ACCESS error
another iPhone newbie question... I have the following: NSPersistentStoreCoordinator NSManagedObjectContext NSManagedObjectModel Is it possible
I am a cocoa newbie trying to create an iPhone app including Core Data.
I'm not a newbie since I've been programming on and off since 1983, but
Newbie question since I'm not up to speed using maven at all. I'm trying
Dear All, please help me since I'm newbie in SQL Server. I have a
newbie for clearcase. Since clearcase's config is rather different from other concept in git,
This might be a newbie question :) but it's irritating me since I'm new
Since I got the advice to make another question here it goes... I want
Coming up towards the end of developing an iPhone application and I'm wondering just

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.