Re: Should I retain/release IBOutlet?
Re: Should I retain/release IBOutlet?
- Subject: Re: Should I retain/release IBOutlet?
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 17 May 2006 15:44:33 -0700
On May 17, 2006, at 1:02 PM, Eric wrote:
On 5/17/06, Julien Jalon <email@hidden> wrote:
object -> object IBOutlet link does not suppose any retain-
release. If
you have a top-level object instantiated by the nib-loading linked to
an other object using IBOutlet, this top-level object is not
considered having any ownership to that other object so does not need
to release it.
Nobody can answer your question "If my custom controller class
contains IBOutlet to other objects in the nib (like UI element),
should
the custom controller retain its IBOutlets" as we don't know what the
relationship between your controller and that UI element is meant to
be. If you consider that the controller needs ownership to that
element, you need to add an extra retain after nib-loading ensuring
that your controller will prevent the element to be deallocated
without its consent.
This is misleading/inaccurate/wrong.
So I can kind of consider IBOutlet to be a type of weak reference.
As a *general* statement, no.
IBOutlet is simply a flag used specifically by Interface Builder. It
has no other semantics. Look to see what it's defined as...
I don't understand why it seems so difficult to accept what's written
in the documentation? It's all covered there, and there's not much
to it...
mmalc
_______________________________________________
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