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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:48:16+00:00 2026-06-05T03:48:16+00:00

I am trying to pass data back from one TabBarViewController to my MasterViewController however

  • 0

I am trying to pass data back from one TabBarViewController to my MasterViewController however when tyring to pass data back to the MasterViewController the method from my protocol/Delegate never gets accessed.

This is what I have done –
I have a TabBarViewcontroller and a MasterViewController, the TabBarController is added to the MasterViewController as a subview… what I am trying to do is then load another subview onto the MasterViewController which I plan to do when a tabbarbutton is selected in the tabBarViewController i call my protocol/delegate method. for this I am using the following code. (I hope this makes sense so far)

TabBarViewController.h

@class MasterViewController;

@protocol LoadActionView <NSObject>
@required
- (void) loadViewsAction;
@end

@interface TabBarViewController : UIViewController <UITabBarDelegate> {


    __weak id <LoadActionView> delegate;

//..
}

@property (weak, nonatomic) id delegate;

//..

TabBarViewController.m

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
    switch (item.tag) {
        case 0:
        {
             NSLog(@"item 1 selected");
            [[self delegate] loadViewsAction]; //the thread defiantly makes it here as I have debugged to this point
        }
//..

then,
MasterViewController.h

 #import <UIKit/UIKit.h>
    #import "TabBarViewController.h"

    @interface MasterViewController : UIViewController <UINavigationControllerDelegate, LoadActionView> {


TabBarViewController *tbVC;

}

@property (nonatomic, strong) TabBarViewController *tbVC;
    //..

MasterViewController.m

#import "TabBarViewController.h"

@synthesize tbVC;
    //..

- (void) viewDidLoad {
//..

tbVC = [[TabBarViewController alloc] initWithNibName:@"TabBarViewController" bundle:[NSBundle mainBundle]];
    UIView *tbView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 367.0, 320.0, 49.0)];
    [tbView addSubview:tbVC.view];
    [otherNav.view addSubview:tbView];


}

    - (void) loadViewsAction
    {
        NSLog(@"HITME!"); //threads not making it here.
    }

the only thing different form what I normally do here is the fact that this TabBarViewController is being added as a subview.. so I am woundering if thats screwing things up.. but if so I have no idea how to fix…

any help would be greatly appreciated.

  • 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-05T03:48:17+00:00Added an answer on June 5, 2026 at 3:48 am

    You can debug the problem by adding:

    NSAssert (nil != [self delegate]);
    

    just before the call to loadViewsAction. That assert will fail because you have not assigned the TabBarController’s delegate. After creating the TabVarController, perform:

    tbVS.delegate = self;
    

    You’ll then have a delegate to use for loadViewsAction.

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

Sidebar

Related Questions

I'm trying to pass post data from one page to the next but PreviousPage
I'm trying to write my own protocol so that multiple servers can pass data
I'm trying to pass a form's data to my controller method using JQuery Ajax,
I am trying to pass data from SQL, to C#, then to an R
I am trying to pass in mutliple data into AJAX .post(). This is what
I am trying to use SequenceFile to pass data between two mapReduce programs. The
I am trying to make an app that will pass data between two servers
I'm trying to make simple script using jquery $post function to pass data to
I'm trying to pass some parameters into a data annotation, and it is rejecting
I'm wondering if it is possible to pass form data from index.jsp file to

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.