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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:20:24+00:00 2026-06-15T14:20:24+00:00

Something about inheritance, I have two class here: female, the subclass of human, and

  • 0

Something about inheritance, I have two class here: female, the subclass of human, and human, it can run but showing issues.

Two issues here:

main.m:29:10: ‘human’ may not respond to ‘setSexy:’

main.m:30:10: ‘human’ may not respond to ‘isSexy’

main.m

#import <Foundation/Foundation.h>
#import "female.h"

int main(int argc, const char * argv[])
{

    @autoreleasepool {

        human *sexyGirl = [[female alloc] init];

        [sexyGirl setName:@"SexyGirl"];
        [sexyGirl setGender:0];
        [sexyGirl setSexy:1];
        [sexyGirl isSexy];

    }
    return 0;
}

female.h

#import "human.h"

@interface female : human {
    BOOL sexy;
}

@property BOOL sexy;

-(void)isSexy;

@end

human.h

#import <Foundation/Foundation.h>

@interface human : NSObject {
    NSInteger *hp;
    NSString *name;
    BOOL gender;
}

@property (assign, nonatomic) NSInteger *hp;
@property (assign, nonatomic) NSString *name;
@property (assign, nonatomic) BOOL gender;

-(void) walk;

@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-15T14:20:25+00:00Added an answer on June 15, 2026 at 2:20 pm

    There is no method name isSexy and setSexy in human class

    You should change this human *sexyGirl = [[female alloc] init];

    to this female *sexyGirl = [[female alloc] init];

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

Sidebar

Related Questions

I've been reading about inheritance but I still dont have it 100% clear, here
I have a model with some inheritance worked into it, but here's the thing,
this is something I have always had confusion about I never can seem to
I remember reading something about it a few years back but I don't remember
I may be missing something about the fundamentals of WPF design, but I was
I learned something about DLL's yesterday. But I haven't found the way how to
I am beginning to work with Symfony, I've found some documentation about inheritance. But
I have recently had two telephone interviews where I've been asked about the differences
I'm thinking about how to do this, but I have several different shapes of
So here is my dilemma: I have a base class (Let's say a generic

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.