• 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
A legitimate argument for calling dealloc directly?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A legitimate argument for calling dealloc directly?


  • Subject: A legitimate argument for calling dealloc directly?
  • From: Daniel Jalkut <email@hidden>
  • Date: Mon, 13 Jan 2003 16:52:34 -0800

I am implementing a class of object that needs to periodically "reinitialize" itself (in response to changed files on disk). This class inherits from a class that is out of my direct control, so as far as I can tell the only "safe" way to make sure that both the super class and my own instance variables are "reset" is to manually call [self dealloc] and then [self init].

I know calling dealloc instead of release is discouraged, but in this case I don't want to release and reallocate (the object is being managed in a data structure, and I'd like the data structure to keep the same "handle" on it).

Is this totally skanky? Is there something dangerous I'm overlooking here? Is there a better way to "reinvent" an object at the same address of the old one? I could, instead of subclassing the super, just keep an instance variable for it, but then I'd lose the convenience of calling super's methods directly on my class.

Thanks for any opinions,
Daniel
email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: A legitimate argument for calling dealloc directly?
      • From: mathew <email@hidden>
    • Re: A legitimate argument for calling dealloc directly?
      • From: Marcel Weiher <email@hidden>
    • Re: A legitimate argument for calling dealloc directly?
      • From: Dietrich Epp <email@hidden>
  • Prev by Date: Re: Module unlinking
  • Next by Date: Frustrating...
  • Previous by thread: Re: Bottom part of the Interface Builder size inspector and window
  • Next by thread: Re: A legitimate argument for calling dealloc directly?
  • Index(es):
    • Date
    • Thread