• 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
Re: question about -init methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about -init methods


  • Subject: Re: question about -init methods
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 07 Jul 2006 10:25:57 -0700
  • Thread-topic: question about -init methods

On Fri, 7 Jul 2006 18:54:59 +0530, Vinay Prabhu
<email@hidden> said:
>It can be done, provided the alloc should not be called again.

Lots of things *can* be done. The question is, *should* it?

(Example: you *can* write a dealloc method without calling super dealloc.
But don't!)

I think what I'd like to hear the OP focus on is *why* he thinks he might
need to do this. Since an instance "re-initialized back to its initial
state" would be effectively the same as a completely new instance, why not
use a completely new instance? What do you think "re-initialization" would
get you? m.

>-----Original Message-----
>From: cocoa-dev-bounces+vinayprabhu=email@hidden
>[mailto:cocoa-dev-bounces+vinayprabhu=email@hidden]On
>Behalf Of Rob Ross
>Sent: Friday, July 07, 2006 2:22 PM
>To: email@hidden
>Subject: question about -init methods
>
>
>Is is mandatory that Objective-C class instances have their
>designated initializer called only once? Can you design an
>initializer so that it can be called again to re-initialize the
>instance back to its initial state, or is that considered bad form?

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



 _______________________________________________
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

  • Follow-Ups:
    • RE: question about -init methods
      • From: Vinay Prabhu <email@hidden>
    • Re: question about -init methods
      • From: Rob Ross <email@hidden>
    • Re: question about -init methods
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: Core Data: Single entity in NSDocument?
  • Next by Date: Re: [Moderator] List guidelines and related resources
  • Previous by thread: RE: question about -init methods
  • Next by thread: Re: question about -init methods
  • Index(es):
    • Date
    • Thread