Skip to content

PKObject.overrideSuper

kerrishotts edited this page Apr 1, 2013 · 2 revisions

(part of PKObject)

Return Type: void

Parameters: theClass (string), theFunctionName (string), theActualFunction (function)

Overrides an existing method.

  • theClass: the object's current class. Usually code will use self.class.
  • theFunctionName: the name of the function to override. Used internally as a key for the function.
  • theActualFunction: The function to override. Usually self.<function>

Once overridden, the class should immediately declare the override.

Usage

newObject = function ()
{
    ...
    self.overrideSuper ( self.class, "initWithOptions", self.initWithOptions )
    self.initWithOptions = function ( options )
    {
        self.super ( "newObject", "initWithOptions", options );
        ...
    }
    ...
}

Version

0.3 Introduced; docs valid

Clone this wiki locally