• 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
Should I use a factory method here?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Should I use a factory method here?


  • Subject: Should I use a factory method here?
  • From: "D.K. Johnston" <email@hidden>
  • Date: Thu, 22 Jun 2006 10:12:06 -0700

I have a text view in a window and a controller class that manages it. There is a one-to-one correlation between these controllers and their windows. The controller object is the delegate of the window, and it's told to releases itself when the window closes.

My question is: Should I use a +init factory method to instantiate the class, instead of the usual [[alloc] -init] procedure?

I _think_ the answer is "yes", since I should never send a release message to any of these objects; but I'd feel better if I had an expert second opinion.

dkj
_______________________________________________
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: Should I use a factory method here?
      • From: Nir Soffer <email@hidden>
  • Prev by Date: Re: Date Format Conversion
  • Next by Date: Background app that can display windows
  • Previous by thread: Re: Newbie Q : connections between different nibs
  • Next by thread: Re: Should I use a factory method here?
  • Index(es):
    • Date
    • Thread