self
Last updated at 1:06 pm UTC on 16 January 2006
- within a method self is a constant reference to the object that received the method (selector/message) call
- self is provided so that a method can call other methods for the same object that is associated with it
Example:
Assume this class has both an expandBy: and an expandTo: method, expandBy can use expandTo: to complete its function
expandBy: value
self expandTo: ((self size) + value)