Re: why Obj-C
Re: why Obj-C
- Subject: Re: why Obj-C
- From: Ondra Cada <email@hidden>
- Date: Fri, 5 Apr 2002 12:29:46 +0200
On Friday, April 5, 2002, at 11:57 , Chris Purcell wrote:
Yes, and as a result it is recommended you make no self calls during an
object's init methods, as they may access data in a superclass that has
not yet been initialized. The exception is generally calling self's
designated initializer (as that is supposed to be called), and possibly
accessors if you can guarantee that no superclass will ever override them
to do something unexpected. But in general, there is no way of ensuring
you call the code you yourself have written!
Sorry, but that's a very nice bunch of... total nonsenses. Just the worst
one: since you've used self's (or super's) designated initializer first,
you are sure that all superclass data are initialized. Theoretically
_subclass_ data might be uninitalized, but that's a problem of implementor
of the subclass (to prevent that);
There's much more (like showing that and why the fact you can't "guarantee
that no superclass will ever override" this or that is The Very Right
Thing), but I haven't time for that.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.