Re: why Obj-C
Re: why Obj-C
- Subject: Re: why Obj-C
- From: Byron Sinor <email@hidden>
- Date: Fri, 5 Apr 2002 04:29:26 -0800 (PST)
In fact, isn't
self = [super init];
A rather common thing to place in an init method
(often withing an if conditional)? And accepted as a
good thing to do?
-Byron
--- Ondra Cada <email@hidden> wrote:
>
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.
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
_______________________________________________
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.