Top "Self" questions

A keyword used in instance methods to refer to the object on which they are working.

need self to set all constants of a swift class in init

I have a Swift class that has a constant ivar (are they called instance constants now?). To set the value …

swift self initializer
Is there a generic way for a function to reference itself?

I can access a python function's attribute inside of function itself by below code: def aa(): print aa.__name__ print …

python function reference self
What does 'self' refer to in a @classmethod?

I thought I was starting to get a grip on "the Python way" of programming. Methods of a class accept …

python self class-method
In Ruby, inside a class method, is self the class or an instance?

I know that self is the instance inside of an instance method. So, then, is self the class inside of …

ruby class instance self class-method
Distinction in Swift between uppercase "Self" and lowercase "self"

While playing in a Swift playground I noticed that Self, with capital "S", is available along with the lowercase self. …

swift self
Understanding the difference between `self`and `cls` and whether they refer to the same attributes

I'm trying to understand if there are differences between self and cls but I'm struggling, even though a lot of …

python class self
self.delegate = self; what's wrong in doing that?

self.delegate = self; what's wrong in doing that? and what is the correct way of doing it? Thanks, Nir. Code: (…

iphone uitextfield delegates self
Java: Self for static method calls within the same class

Is it possible to do something like self:: in PHP to not need to specify the class-name tro call a …

java class methods self
(Ruby,Rails) Context of SELF in modules and libraries...?

Quick question regarding the use of "SELF" inside a module or library. Basically what is the scope/context of "SELF" …

ruby-on-rails ruby scope self
What's the Point of Using [self class]

Is this code correct @implementation Vehicle +(id) vehicleWithColor:(NSColor*)color { id newInstance = [[[self class] alloc] init]; // PERFECT, the class is // …

objective-c xcode class self