The self
method is defined in the NSObject
protocol, so every object be it an instance of a class or a class object (of type Class
) supports the method. It simply returns the object it is called on, i.e. something like:
- (id) self { return self; }
So self
on an instance returns the instance, and on a class object returns the class object.
The following therefore holds: [x self] == x
is YES
for all instance and class objects x
And your line is equivalent to:
NSRect selBounds = [SKTGraphic boundsOfGraphics:selGraphics];
So that is what it does. As to why Apple wrote it this way, that's a different question...