Menu

#1 Initialization method

open
nobody
None
5
2002-11-26
2002-11-26
Anonymous
No

I noticed that when I subclassed the XMLParser class, my class's init method was not being called. So I looked into XMLParser.m for the cause. I found that in the XMLParser initializer called init:encoding:sep:bs: the init method of the superclass was called:
[super init].

It would be better if init was called on XMLParser instead of it's superclass's:
[self init]

That way my subclass's init would get called.
I suggest you consider this, as subclassing the init method is a common practice in ObjC coding.

Cheers,

Rudi Angela

Discussion


Log in to post a comment.