FROM : glenn andreas
DATE : Sat Aug 19 19:47:24 2006
On Aug 19, 2006, at 11:41 AM, John McLaughlin wrote:
> Hi Glenn,
>
> You bring up a good point -- In my case I use Accessorizer
> extensively so I never, ever, set anything except through setters
> so I wouldn't leak (although it is arguable less efficient since
> you init an object that then immediately get's deallocated)
This is just designed to be a simple example showing why it can be
bad to call init a second time - you just plain shouldn't call an
initializer twice on the same object - see also the thread <http://
lists.apple.com/archives/cocoa-dev/2006/Jul/msg00475.html>.
Even if you make sure that all your code is safe to do this (even if
you use accessors in Obj-C 2.0), you have no control over all the
other code in the various frameworks that you use, so one should
avoid getting into bad habits that will someday come back to bite you...
Glenn Andreas <email_removed>
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures,
fractals, art
DATE : Sat Aug 19 19:47:24 2006
On Aug 19, 2006, at 11:41 AM, John McLaughlin wrote:
> Hi Glenn,
>
> You bring up a good point -- In my case I use Accessorizer
> extensively so I never, ever, set anything except through setters
> so I wouldn't leak (although it is arguable less efficient since
> you init an object that then immediately get's deallocated)
This is just designed to be a simple example showing why it can be
bad to call init a second time - you just plain shouldn't call an
initializer twice on the same object - see also the thread <http://
lists.apple.com/archives/cocoa-dev/2006/Jul/msg00475.html>.
Even if you make sure that all your code is safe to do this (even if
you use accessors in Obj-C 2.0), you have no control over all the
other code in the various frameworks that you use, so one should
avoid getting into bad habits that will someday come back to bite you...
Glenn Andreas <email_removed>
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures,
fractals, art
| Related mails | Author | Date |
|---|---|---|
| John McLaughlin | Aug 18, 05:26 | |
| Greg Hurrell | Aug 18, 05:39 | |
| Ricky Sharp | Aug 18, 05:42 | |
| Byron Wright | Aug 18, 07:45 | |
| Jim Correia | Aug 18, 13:50 | |
| John McLaughlin | Aug 18, 21:53 | |
| glenn andreas | Aug 18, 22:09 | |
| Shawn Erickson | Aug 18, 23:12 | |
| John McLaughlin | Aug 19, 18:41 | |
| glenn andreas | Aug 19, 19:47 | |
| Jim Correia | Aug 19, 23:14 | |
| John McLaughlin | Aug 20, 04:58 |






Cocoa mail archive

