lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Here is an Objective-C example on how to add "behavior" to another class. In a nutshell, a class in Objective-C is simply a structure holding methods (aka functions). You can therefore easily move methods (aka "behaviors") from one class to another. So instead of (ab)using inheritance, one is more likely to use "composition".

Cheers

--
PA
http://alt.textdrive.com/


Attachment: behavior.m
Description: Binary data