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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:40:44+00:00 2026-06-07T12:40:44+00:00

I am really struggling with with passing variables from one class to another. I

  • 0

I am really struggling with with passing variables from one class to another. I was following the answer in this question, and was able to implement the first part (Passing Data Forward) successfully. My problem is when I get to the second part (Passing Data Back), I get hung up on 4) where I need to declare an interface for my second.h file. I already have an interface declared in that .h file:

@interface RootViewController : UITableViewController <UISplitViewControllerDelegate>{

And when I try to declare another one, I run into lots of errors. I read that it is possible, I am just not sure the exact syntax I guess.

Here’s the complete .h file

#import <UIKit/UIKit.h>


@protocol SubstitutableDetailViewController
- (void)showRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem;
- (void)invalidateRootPopoverButtonItem:(UIBarButtonItem *)barButtonItem;
@end


@interface RootViewController : UITableViewController <UISplitViewControllerDelegate>{

    UISplitViewController *splitViewController;

    UIPopoverController *popoverController;    
    UIBarButtonItem *rootPopoverButtonItem;

    NSMutableArray *logMessages;
}

@property (nonatomic, assign) IBOutlet UISplitViewController *splitViewController;

@property (nonatomic, retain) UIPopoverController *popoverController;
@property (nonatomic, retain) UIBarButtonItem *rootPopoverButtonItem;


@end
  • 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-07T12:40:46+00:00Added an answer on June 7, 2026 at 12:40 pm

    To add a second (or third or fourth) interface, just put it in with a comma

    Example you say? I suppose I could do one.

    @interface ViewController : UIViewController <DateControllerDelegate, TimeControllerDelegate, DivisionControllerDelegate, FormControllerDelegate, MemoryControllerDelegate, UIAlertViewDelegate, UITextFieldDelegate, UIActionSheetDelegate, UITableViewDelegate, UITableViewDataSource, NSFetchedResultsControllerDelegate, MFMailComposeViewControllerDelegate> {
    

    It looks like you need to look up the delegate method. Here’s the simplest explanation of it that I could come up with.

    Delegates
    
    //In parent .m file:
    //assign the delegate
    - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if([segue.identifier isEqualToString:@"segueName"])
        {
            childController *foo = segue.destinationViewController;
            foo.delegate = self;
        }
    
    }
    
    //implement protocol method(s):
    - (void) methodName:(dataType*) dataName
    {
        //An example of what you could do if your data was an NSDate
        buttonLabel.titleLabel.text = [[date description] substringToIndex:10];
    }
    
    //In parent .h file:
    //import child header
    #import "ChildName.h"
    
    //indicate conformity with protocol
    @interface ParentName : UIViewController <ChildNameDelegate>
    
    //In child .h file
    //declare protocol
    @protocol ChildNameDelegate
    - (void) methodName:(dataType*) dataName;
    @end
    
    //declare delegate
    @property (unsafe_unretained, nonatomic) id<ChildNameDelegate> delegate;
    
    
    //In child .m file
    //synthesize delegate
    @synthesize delegate; 
    
    //use method
    - (IBAction)actionName:(id)sender 
    {
        [delegate methodName:assignedData];
    }
    

    And here’s a good answer about delegates that’s probably way better than mine:
    How do I create delegates in Objective-C?

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

Sidebar

Related Questions

I am really struggling with this question: import java.util.regex.*; class Regex2 { public static
Really struggling to figure this out. Just trying to take in data from php
I'm really new to Ruby (first day!) and I'm struggling with this here. I'm
really struggling with this one. I've recently setup a bash shell script to extract,
I'm really struggling to get this to work in xcode 4. I have one
Hi I am really struggling with this one. I am developing with Google Analytics
Really been struggling with this one for some time now, i have many text
Really struggling with this one: I have an existing foreach, containing an if loop
Really struggling to get this to work. I've declared the window from the xib
Im really struggling to get my head round this. Im using c#. I want

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.