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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:49:58+00:00 2026-06-05T04:49:58+00:00

I have two controllers (first,second) in a storyboard, xcode 4.2. First controller has a

  • 0

I have two controllers (first,second) in a storyboard, xcode 4.2.

First controller has a tableview and embedded in navigation controller.
Second controller has a tableview too and embedded in navigation controller (not same as the first)

In first.h:

#import "second.h"
...
@interface first : UIViewController <secondDelegate, UITableViewDelegate, UITableViewDataSource>
...

In first.m:

- (IBAction)add:(id)sender // action when tapped a button on topbar
{
    [self performSegueWithIdentifier:@"addSegue" sender:sender];
}

....

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([[segue identifier] isEqualToString:@"addSegue"])
    {
        NSLog(@"delegated");
        second *controller=[segue destinationViewController];
        controller.delegate=self;
    }
}

- (void)callback
{
     NSLog(@"Callback here");
}

Segue is a modal segue with default transition.

second.h:

@protocol secondDelegate
   -(void)callback;
@end

....

id <secondDelegate> delegate;
@property (nonatomic,assign) id <secondDelegate> delegate;

second.m:

... (button of topbar tapped action) ...
[self dismissModalViewControllerAnimated:YES];
NSLog(@"class: %@",[self delegate]);
[[self delegate]entryGroupDoneButtonTapped];

Summary:

I don’t see the “callback here” message, but I’ve got a “delegated” message. The “class: ” debug line print “null”.

Why?

(I can send any data from first to second with this, only delegate’s callback not works)

  • 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-05T04:50:00+00:00Added an answer on June 5, 2026 at 4:50 am

    I found a solution: the destinationViewController returns a UInavigationController, so we can use: AddDrinkViewController *controller=[[[segue destinationViewController]viewControllers]objectAtIndex:0];

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

Sidebar

Related Questions

I have two controllers in the storyboard, embedded in a NavigationController, and there is
I have two controllers with the same actions and private methods. The second one
I am using Storyboard with a Navigation Controller and prepareforsegue. I have two UITableViews.
I have a view that has two buttons(First and Second) and one hidden field.
I have two views with navigation controller: first view, there are empty text fields
I have two view controllers, in which I am using navigation controller to navigate
I have tabbar - two tabs with navigation controller in each. On second card
Say if I have a controller, profile, which has just two actions. The first
I have two view controllers that allow changes to the Address Book. The first
Currently using Xcode 4.2 and I have two view controllers (1 and 2). 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.