• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Class clusters and the superclass' initializer implementation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Types for the method have to conform?
  • Next by Date: Re: Option-click on my app hides the other app
  • Previous by thread: Re: Types for the method have to conform?
  • Next by thread: App Delegate and Responder Chain
  • Index(es):
    • Date
    • Thread