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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:33:10+00:00 2026-05-17T02:33:10+00:00

can someone tell the difference between objective C’s self and C++ this pointer?

  • 0

can someone tell the difference between objective C’s self and C++ this pointer?

  • 1 1 Answer
  • 3 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-17T02:33:10+00:00Added an answer on May 17, 2026 at 2:33 am

    The main difference is that this is a keyword, while self is a variable. The result of this is that while this always refers to the object that is executing a particular method, Objective-C methods are free to modify self during execution. This is sometimes used by constructors, which set self = nil on failure.

    The reasons for doing so are:

    • so that subclasses (which chain initialisers with self = [super init]) can see when the initialisation fails and know not to carry on in their own initialisers.
    • composing objects can see the failure and know that they don’t have a valid component.

    Some initialisers will set self to a different, but valid, object. This can be used in class clusters, where the “abstract” class can generate a temporary instance while building the initialised object, but ultimately return a different object based on the properties that were built up during construction.

    In addition, it means that you can do the usual things with variable names that confuse everyone that you can’t do with keywords, such as defining a more local variable with the same name self in a code block.

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

Sidebar

Related Questions

Can someone tell me the difference between: $(document).ready(function() { }); and: var someVar =
Can someone tell me what's the difference between a .profile and a .make file
Can someone tell me what is the main difference between a JavaScript object defined
Can someone tell me what the difference is between the following public class CarCollection<T>:List<T>
Can someone tell me what the difference is between these two conventions for getting
Can someone tell me the difference between <bean id=b1 class= /> <bean id= class=>
Can someone tell me what is the difference between active and passive FTP? Which
Can someone tell me in really slow terms the difference between these 2 lines
Can someone tell me if there is any difference between DROP IF EXISTS [TABLE_NAME]
Can someone tell me the exact difference between mobile agents and web crawlers? Thanks

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.