• 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: State of instance variables defined at instantiation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: State of instance variables defined at instantiation?


  • Subject: Re: State of instance variables defined at instantiation?
  • From: Wade Tregaskis <email@hidden>
  • Date: Wed, 28 May 2003 08:16:06 +1000

This is only a problem if you don't provide other init methods. In such a case, the user should probably be using them anyway, and so the lack of a generic init method would be unimportant.

ok, thanks. is there ever a time that you can get away with just alloc-ing an object, and not init-ing it? and continue as usual?

Well, you can, probably without ill-effect in most cases, if the default init doesn't actually do anything. But it's bad form, because it may well break your code in future (if and when the init function actually does something important). Plus it'll confuse people reading your code - "why haven't they initialized any of these?".

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.

References: 
 >Re: State of instance variables defined at instantiation? (From: Ben Dougall <email@hidden>)

  • Prev by Date: Cocoa litterature
  • Next by Date: Error 1000 and no menus or icon???
  • Previous by thread: Re: State of instance variables defined at instantiation?
  • Next by thread: Re: State of instance variables defined at instantiation?
  • Index(es):
    • Date
    • Thread