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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:43:36+00:00 2026-05-26T18:43:36+00:00

Before I start let me ask that in objective-c 2.0 you can have a

  • 0

Before I start let me ask that in objective-c 2.0 you can have a baseclass pointer reference a subclass object?

If so is there something similar to c++ virtual member functions in objective-c.

For instance if a subclass object gets called from a baseclass pointer, will it call the subclass method (it properly overrides the base class method)? Would it be forced as well like Java or does the programmer have control over it?

Edit: would it be possible to assign any pointer type to another, what is the limit? Ex:
Can you say

Subclass *s = …
Baseclass *b= s

Or can it only be done by allocation?

  • 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-26T18:43:37+00:00Added an answer on May 26, 2026 at 6:43 pm

    You can have a base class pointer hold onto the value of a subclass instance’s address. So

    Subclass s* = /* get an object instance */
    Baseclass b* = s;
    

    is possible (this doesn’t have to be during init). There isn’t a limit.

    The “virtual method” like functionality is like Java, so every method is virtual so you don’t have control over it (e.g. the subclass method is always called). Messages being sent to objects have, in effect, late binding.

    See Implement a pure virtual method in Objective-C .

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

Sidebar

Related Questions

OK, so before we start let me state that I have been googling and
Before I start with the real question, let me just say that I might
Let me post some code before I ask question. public Object returnSomeResult() { Object
Before I start, I'm already aware that object immutability in Python is often a
Before I start, let me say that I looked at all the similar questions
Before start let me tell my experience: I am experienced with C#.NET, web services,
Before you start laughing at such a simple question let me explain: I am
Ok here is my problem : Before i start the description, let me to
Let's say I'd like to start a small linux distro before my ordinary operating
Before I start, I know there is this post and it doesn't answer my

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.