Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)
Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)
- Subject: Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 19 Nov 2008 14:44:04 -0800
On Nov 19, 2008, at 1:57 PM, Brian Stern wrote:
I'm starting to think that maybe using the assign properties is the
better way to handle this.
That's certainly one approach, and one that was considered.
The problem is that you then have to think through every outlet
declaration to make sure that you use the appropriate decorator, and
you potentially run the risk of accessing dangling pointers --
something that's typically going be a more significant issue than not
disposing of an object at an opportune moment...
As noted previously, the goal with best practice here is precisely to
relieve you of having to think about such banalities(*).
If you simply follow best practices, you get a good pattern that won't
cause a crash and that allows you to concentrate on more important
aspects of your application.
Dealing with memory warnings is a slightly special case that's arisen
fairly early on in the lifetime of a new platform.
As an issue, it doesn't have any direct bearing on what is in general
the best way to deal with outlets -- it's largely orthogonal.
It should be managed better than it is now, and hopefully it will be
in the future. In a way that doesn't require great mental effort to
get right.
mmalc
(*) I'm grateful to Henry for having pointed me to an apposite
quotation from Alfred North Whitehead:
"It is a profoundly erroneous truism, repeated by all copy-books and
by eminent people when they are making speeches, that we should
cultivate the habit of thinking of what we are doing. The precise
opposite is the case. Civilization advances by extending the number of
important operations which we can perform without thinking about them.
Operations of thought are like cavalry charges in a battle--they are
strictly limited in number, they require fresh horses, and must only
be made at decisive moments."
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden