Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference b/w Objective C's self and C++'s this?

Tags:

People also ask

What is the difference between Objective-C and C?

The main difference in C and Objective C is that C is a procedure programming language which doesn't support the concepts of objects and classes and Objective C is Object-oriented language which contains the concept of both procedural and object-oriented programming languages.

What is difference between self and this?

The keyword self is used to refer to the current class itself within the scope of that class only whereas, $this is used to refer to the member variables and function for a particular instance of a class.

What is Self Objective-C?

self is a special variable in Objective-C, inside an instance method this variable refers to the receiver(object) of the message that invoked the method, while in a class method self will indicate which class is calling.

What is the difference between this and self in Python?

Technically both self and this are used for the same thing. They are used to access the variable associated with the current instance. Only difference is, you have to include self explicitly as first parameter to an instance method in Python, whereas this is not the case with Java.


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