Class clusters and the superclass' initializer implementation
Class clusters and the superclass' initializer implementation
- Subject: Class clusters and the superclass' initializer implementation
- From: John Calsbeek <email@hidden>
- Date: Wed, 10 Aug 2005 20:17:34 -0500
Hey,
Theoretical question which is probably much ado about nothing: in the
abstract superclass of a class cluster, what should the actual
implementation of the primitive initializer(s) look like? (I need
one, or else gcc will complain.) Currently I have:
- (id)initWithData:(NSData *)data withOptions:(NSDictionary *)options
error:(NSError **)errorPtr
{
[self doesNotRecognizeSelector:_cmd];
return nil;
}
but in a theoretical case where this actually would get called, we'd
get an orphaned object floating around, because there's no call to
[self release] in there. Placing a [self release] before or after the
-doesNotRecognizeSelector: call wouldn't work: before would mean
sending a message to a freed object and after would never get called,
since -doesNotRecognizeSelector: raises an exception. I'm leaning
towards a simple [self autorelease] as the first line... is there
another standard for what these kinds of methods should look like?
-John Calsbeek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden