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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:10:28+00:00 2026-06-12T08:10:28+00:00

I have created three view controllers, namely FirstViewController , SecondViewController & ThirdViewController . The

  • 0

I have created three view controllers, namely FirstViewController, SecondViewController & ThirdViewController. The FirstViewController pushes SecondViewController, and similarly SecondViewController pushes ThirdViewController.

The ThirdViewController is a UITableViewController.

The SecondViewController and ThirdViewController have custom protocols. Both of them are pass some value to FirstViewController using their respective delegates.

The problem is that SecondViewController is successfully passing on the value to FirstViewController, but the ThirdViewController is not being able to do it.

Is it because the SecondViewController is directly being navigated from FirstViewController, so it is able to pass it, and ThirdViewController is not connected with the FirstViewController so it is not being able to pass the data?

Any help would be appreciated.

EDIT:

The FirstViewController just pushes SecondViewController through a button action.

The SecondViewController.h is:

@protocol secondViewDelegate <NSObject>

-(void)didCompleteSending:(NSArray *)array;

@end


@interface secondView : UIViewController
@property (nonatomic,strong) NSArray *footballPlayers;
@property (assign) id<secondViewDelegate>delegate;
- (IBAction)btnAction:(id)sender;
- (IBAction)btnGoToThirdView:(id)sender;

The SecondViewController.m is:

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.

footballPlayers = [[NSArray alloc]initWithObjects:@"Rooney",@"Van Persie",@"Ronaldo",@"Kagawa", nil];
}

- (IBAction)btnAction:(id)sender {
[delegate didCompleteSending:footballPlayers];
}
- (IBAction)btnGoToThirdView:(id)sender {
thirdView *objthirdView = [[thirdView alloc]init];
objthirdView.delegate=self;
[self.navigationController pushViewController:objthirdView animated:YES];
}

Similarly I have for ThirdViewController.

In FirstViewController.h
-(void)didSendDetailsFromThirdView:(NSString *)colors{
NSLog(@”selected string is = %@”,colors);
}

-(void)didCompleteSending:(NSArray *)array{
  for (NSString *str in array) {
    NSLog(@"%@",str);
  }
 }

The -(void)didSendDetailsFromThirdView:(NSString *)colors does not get called from ‘ThirdViewController’.

SECOND EDIT

- (IBAction)btnGoToThirdView:(id)sender {
FirstViewController *objFirstViewController = [FirstViewController alloc]init];
thirdView *objthirdView = [[thirdView alloc]init];
objthirdView.delegate=objFirstViewController;
[self.navigationController pushViewController:objthirdView animated:YES];
}
  • 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-12T08:10:29+00:00Added an answer on June 12, 2026 at 8:10 am

    You are setting the delegate of the ThirdViewController in the the SecondViewController.m to self

    objthirdView.delegate=self;
    

    this means that the delegate of the ThirdViewController is the SecondViewController and not the FirstViewController. Keep a reference to the FirstViewController in the SecondViewController and use it as the delegate like this.

    objthirdView.delegate=myFirstViewController;
    

    Assuming it is not possible to pop from ThirdViewController to the FirstViewController you can maybe misuse the SecondViewController for passing the data back to the FirstViewController via delegate methods you already implemented. But I would not recommend it – it is not a good design.

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

Sidebar

Related Questions

i have a custom tabBar class in which i switch three view controllers ,i
I have a TabBar which has been created programmatically. In the view controllers of
I have created an iPad app that has 10 view controllers that swipe left
I have created a navigation controller with a stack of view controllers. I want
I have created a web-service app and i want to populate my view controllers
I have created an app for the iPhone where I have two view controllers.
i have programmatically created a tab bar and added 7 view controllers to it
I have created two view controllers in which there is UIImage animations.Its crashing frequently
I wanna create an app that will have three view controllers. To navigate between
I have created a view in which there is a capture button. When i

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.