Py Obj C - Classes

Classes

Objective-C classes are subclassed in the same manner as a normal Python class:

class MyDuck(NSObject): # NSObject is a base Objective-C class. def init(self): self = super(MyDuck, self).init # An Objective-C idiom, wherein the # subclass instance, self, is instantiated # by sending the superclass its # designated initializer. return self myLittleDuckOne = MyDuck.alloc.init

Read more about this topic:  Py Obj C

Famous quotes containing the word classes:

    There were three classes of inhabitants who either frequent or inhabit the country which we had now entered: first, the loggers, who, for a part of the year, the winter and spring, are far the most numerous, but in the summer, except for a few explorers for timber, completely desert it; second, the few settlers I have named, the only permanent inhabitants, who live on the verge of it, and help raise supplies for the former; third, the hunters, mostly Indians, who range over it in their season.
    Henry David Thoreau (1817–1862)

    Classes struggle, some classes triumph, others are eliminated. Such is history; such is the history of civilization for thousands of years.
    Mao Zedong (1893–1976)

    Of all reformers Mr. Sentiment is the most powerful. It is incredible the number of evil practices he has put down: it is to be feared he will soon lack subjects, and that when he has made the working classes comfortable, and got bitter beer into proper-sized pint bottles, there will be nothing left for him to do.
    Anthony Trollope (1815–1882)