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 1011867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:51:29+00:00 2026-05-16T09:51:29+00:00

My app is using a tab bar controller with two tab bar items: Each

  • 0

My app is using a tab bar controller with two tab bar items: Each item is a navigation controller.

I’m trying to access one view controller in one navigation controller from another view controller in the other navigation controller, is that possible?? and How??

I’d appreciate any possible help, Thanks.

Mohsen

  • 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-16T09:51:29+00:00Added an answer on May 16, 2026 at 9:51 am

    You might consider using notifications or (even easier) Key-Value Observing.

    I gave somebody some advice this morning about inter-controller communication in a UINavigationController context. Then this afternoon I tried KVO for the first time, and I had to go back and give different advice. KVO is WAY simpler than trying to chase things down in a view hierarchy. You just declare what’s observing what, and then set that thing up to catch change notifications. Piece of cake!

    EDIT:

    Notifications are probably the way to go here, actually–if you had both object instantiated in one place you could register one as an observer on the other’s keys, but that’s not necessarily the case if you’re building your tab bar from templates.

    So, notifications. The idea is, you register one view controller as a notification observer, then fire notifications from another view controller, and the observer is notified when the notification is sent. It’s a little like your application sending email to itself.

    Registering for and receiving the message looks like this:

    ViewControllerOne.m:

    -(void)viewDidLoad  //a likely place, but not the only place you might do this
    {
        ....
        // whatever else you're doing to initialize your VC, and then
    
        [[NSNotificationCenter defaultCenter]
          addObserver:self
             selector:@selector(iWasNotified:)
                 name:@"myNotification"
               object:nil];
    }
    
    -(void)iWasNotified:(NSNotification *)notification
    {
        NSString *passedValue = (NSString *)notification.object;
        NSLog(@"We got notified and received: %@", passedValue);
    }
    

    And then sending the message is as simple as this:

    ViewControllerTwo.m:

    [[NSNotificationCenter defaultCenter] 
      postNotificationName:@"myNotification"
                    object:@"I'm passing you this NSString object!"];
    

    You are obviously not limited to passing a string in the object: field. A somewhat more likely use would be to pass self, and then you’d have access to any public fields of the notification-posting view controller.

    That’s the bare-bones usage of them. There’s a lot more subtleties you can get into, and it’s all laid out here:
    http://developer.apple.com/iphone/library/documentation/cocoa/Conceptual/Notifications/Introduction/introNotifications.html

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

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can create the custom Adapter and can set the… May 16, 2026 at 5:47 pm
  • Editorial Team
    Editorial Team added an answer Specify the beginning and ending strings via the environment, and… May 16, 2026 at 5:47 pm
  • Editorial Team
    Editorial Team added an answer You are printing your html alright. Right click and look… May 16, 2026 at 5:47 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I created a tab bar application from the template and added a navigation controller
I have a multiview application using a tab bar to switch views. One is
I'm building an app that begins by loading a 'downloading' view controller which fetches
I am new to iphone development. In my app, i am using number of
I have an an iphone app and am using shouldAutorotateToInterfaceOrientation to determine when to
I wrote a small application using iPhone 3.x sdk. The app works well on
I'm building an application based on the Utility template from Xcode, to which I
I'm pretty new to iPhone development but I'm close to releasing my first app
Here is my problem: I've read a lot about how to use a tab
I'm in the process of learning and designing an app for our company. At

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.