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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:18:35+00:00 2026-05-22T19:18:35+00:00

In objective-C I want to have a child class call or invoke a parent’s

  • 0

In objective-C I want to have a child class call or invoke a parent’s method. As in the parent has allocated the child and the child does something that would invoke a parent method. like so:

//in the parent class
childObject *newChild = [[childClass alloc] init];
[newChild doStuff];

//in the child class
-(void)doStuff {
    if (something happened) {
        [parent respond];
    }
}

How could I go about doing this? (if you could explain thoroughly I would appreciate it)

  • 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-22T19:18:36+00:00Added an answer on May 22, 2026 at 7:18 pm

    You can use a delegate for this: have childClass define a delegate protocol and a delegate property that conforms to that protocol. Then your example would change to something like this:

    // in the parent class
    childObject *newChild = [[childClass alloc] init];
    newChild.delegate = self;
    [newChild doStuff];
    
    // in the child class
    -(void)doStuff {
        if (something happened) {
            [self.delegate respond];
        }
    }
    

    There’s an example of how to declare and use a delegate protocol here: How do I set up a simple delegate to communicate between two view controllers?

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

Sidebar

Related Questions

I want to use/reuse C++ object with Objective-C. I have a hello.h that has
Suppose I have Objective C interface SomeClass which has a class method called someMethod
I want to have a compiler (pre-compiler) directive in my objective-C class to distinguish
I want to recognize uppercase letters using objective-c. I have an implementation now that
I want to have an array that is accessible throughout my Objective-C project whose
I have been using objective-C to develop in iOS. Now we want to develop
When I have NSString with /Users/user/Projects/thefile.ext I want to extract thefile with Objective-C methods.
Objective: I want to create a web service that allows me to connect to
I want to know how objective C runtime handle arguments when I call a
Objective Have a small magnifying glass icon that appears in the top right corner

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.