Re: State of instance variables defined at instantiation?
Re: State of instance variables defined at instantiation?
- Subject: Re: State of instance variables defined at instantiation?
- From: Ben Dougall <email@hidden>
- Date: Wed, 28 May 2003 02:02:14 +0100
On Tuesday, May 27, 2003, at 11:16 pm, Wade Tregaskis wrote:
This is only a problem if you don't provide other init methods. In
such a case, the user should probably be using them anyway, and so
the lack of a generic init method would be unimportant.
ok, thanks. is there ever a time that you can get away with just
alloc-ing an object, and not init-ing it? and continue as usual?
Well, you can, probably without ill-effect in most cases, if the
default init doesn't actually do anything. But it's bad form, because
it may well break your code in future (if and when the init function
actually does something important). Plus it'll confuse people reading
your code - "why haven't they initialized any of these?".
i see. i was just curious. i wasn't sure if init was doing something
extra behind the scenes, because often i can't see the point of it.
thanks.
_______________________________________________
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.