Hi all

I am writing some Obj-C classes and, looking at various examples, (e.g.
Learning Cocoa with Objective-C, chapter 3) it seems that some objects do
not need to implement +alloc.  My previous understanding was that you needed
to implement +alloc, -init & -dealloc for all classes - or at least that it
was highly advisable.

I guess if you don't implement +alloc then the message gets sent up to the
superclass (usually NSObject in our case).  If someone could enlighten me
here on the practical implications of these choices and best practice (for
instance, does it make a difference if your class contains instance
variables and whether they are heap allocated or not) then that would be
very helpful.

Thanks in advance

Michael


_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

        _/    _/   _/_/_/             Hopkins Research Ltd
       _/    _/   _/    _/
      _/_/_/_/   _/_/_/          http://www.hopkins-research.com/
     _/    _/   _/   _/
    _/    _/   _/     _/               'touch the future'
                   
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


_______________________________________________
Help-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnustep

Reply via email to