Re: multiple declarations for method
Re: multiple declarations for method
- Subject: Re: multiple declarations for method
- From: "Erik M. Buck" <email@hidden>
- Date: Sat, 26 Jan 2002 14:49:50 -0600
Try either
- (id)initWithParent:(id)aParent
{
NSAssert([aParent isKindOfClass:[TypeA class]], @"Attempt to initialize
with invalid parent");
...
}
or
- (id)initWithTypeAParent:(TypeA *)aParent;
and
- (id)initWithTypeBParent:(TypeB *)aParent;
or
Use a protocol rather than a class name for the type of the argument and
make all parents conform to the same protocol.
or
Try a different requirements for parenthood. Maybe parents are just id.
Not everything has to be completely statically typed even though it is a
good practice. Notice that the initializers all return id so that they work
correctly when inherited.
----- Original Message -----