Re: IBOutlet getter/setter pattern question
Re: IBOutlet getter/setter pattern question
- Subject: Re: IBOutlet getter/setter pattern question
- From: Eeyore <email@hidden>
- Date: Tue, 18 Oct 2011 11:00:49 -0700
Thanks Matt, was kind of hoping you would provide some insight (your responses to others have been helpful).
> Very ingenious, but doesn't it leave a lot of stuff lying around that is just an accident waiting to happen? You are assuming that setLabel: will be called only by the nib-loading mechanism; but how do you know? Someone else can call setLabel: later and get very weird results.
I guess that was my question. When I declare something as an IBOutlet, am I exposing it to others? If I'm the only one to access it, then only I can shoot myself in my foot. However, the question is now moot, see below.
> How about giving the label, if created in the nib, a tag number (how much trouble can that be, since you had to go into the nib in order to make the label in the first place) so that no ivar is needed in order to find it?
I haven't used tags enough in the past to think of it, but this appears to be the solution.
Aaron
_______________________________________________
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