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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:58:52+00:00 2026-05-24T00:58:52+00:00

In my app there are two tabbars. In tab-0 parent class is FirstViewController and

  • 0

In my app there are two tabbars. In tab-0 parent class is “FirstViewController” and in tab-1 parent class is “SecondViewController”. In “SecondViewController” i have declared protocol and custom delegate method. i want to pass the information in “FirstViewController”(FVC). So FVC has to assigned as a delegate.

Now my doubt is, right now i am in “SVC”. How can i assign “FVC” as a delegate of “SVC”?

In “SVC”

[[self delegate] sendCoordinates:self];

Definition of method is in “FVC”. To execute this method, first i need to assign “FVC” as a delegate.

I hope I am clear in explaining my problem.

Thanks in advance.

  • 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-24T00:58:53+00:00Added an answer on May 24, 2026 at 12:58 am

    You need to set the delegate. Let me demonstrate:

    `SVC.h`
    
    @interface SVC
    {
        id _delegate;
    }
    
    - (void)setDelegate:(id)delegate; //sets the delegate
    - (id)delegate; //gets the delegate
    
    @end
    
    @protocol SVCDelegate
    
    - (void)sendCoordinates:(SVC *)svc;
    
    @end
    

    Then, in SVC.m, you call the delegate in exactly the same way as you showed in your question, so [[self delegate] sendCoordinates:self];

    Now, in FVC, you’ll need to #import SVC.h and initialise the object.

    SVC*svcObject = [[SVC alloc] init];
    [svcObject setDelegate:self]; //self now refers to FVC - I think you're missing this one
    //work with the object and when you're done, get rid of it in dealloc:
    [svcObject setDelegate:nil];
    [svcObject release];
    

    In the same class, implement - (void)sendCoordinates:(SVC *)svc and it will be called after you set the delegate.

    I think you’re missing the setDelegate: stage, which is why it doesn’t work.

    Hope it helps!

    Note: In SVC, remember to retain the delegate, or it will become nil and no delegate methods will never be called. Don’t forget to release that delegate once you’re done.

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

Sidebar

Related Questions

I have a simple iPhone app based on a navigation controller. There are two
My app has two distincts modes. There's a tab bar controller in the app
I want to have two radio buttons in my Asp.Net MVC3 App.There is no
I have a tabbar-based iOS app with two tabs. When I tab into the
There are two projects: 1) applet project that outputs jar file 2) web app
We're creating a new consumer/public-facing ASP.Net web app. There are two concerns: --Use cookie
In my app there is requirement that..I have 6 buttons in a nib, when
I have an iPhone app out there that calls home to my server every
I am currently working on a DVD Store App. There are two tables in
I am about to start a new project, a facebook app. There are two

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.