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: Roland King <email@hidden>
- Date: Tue, 18 Nov 2008 12:35:31 +0800
Yes, but this is exactly the point. If I have no property for an
Outlet it's still retained. If I have a property for an outlet that
is assign, and not retain the outlet is still retained, and I still
must release it, even though I never retained it.
When you say I can manage the outlets any way I like this is wrong.
They are managed for me. I want them to not be retained. I don't
have that option.
Now that I understand this I can live with it. But it still makes no
sense to me.
_______________________________________________
That's not what the documentation says and it's not my experience
either. The documentation says (section titled NIB Object Retention)
that each object in the NIB file is created with a retain count of 1 and
then autoreleased. Then they are hooked up using setValue:forKey: which
uses the setter method if it exists. It also explicitly tells you that
if you don't retain the array of top-level objects you're going to lose
them.
So if you have an outlet which is assign, and the setter method is
correct, the object will be created with retain count of 1,
autoreleased, then the setter method will be called and assign it (no
retain) and you do not have to release it. Why do you think that you do?
I've done this, I have this exact patten in some of my iPhone code, I
have a delegate property which is assign and it is assigned and it goes
away when it's supposed to go away.
_______________________________________________
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