Re: Connecting Outlet on Derived Array Controller
Re: Connecting Outlet on Derived Array Controller
- Subject: Re: Connecting Outlet on Derived Array Controller
- From: Ken Thomases <email@hidden>
- Date: Sun, 28 Feb 2010 12:30:19 -0600
On Feb 28, 2010, at 11:48 AM, Joanna Carter wrote:
> I think I need to add an outlet to an array controller.
Why do you think that? What aspect of your design leads you to that conclusion?
> Thus I have created a derived class and added the outlet to the class.
Normally, an outlet would be something that the class inherently uses (or would use if connected). Since NSArrayController has no already existing need for the outlet you're adding, and doesn't know to use it if it's present and connected, it doesn't make sense to create a subclass solely for the purpose of adding it.
If you were making a subclass for some other purpose and, in the process of designing and implementing that subclass you found it needed such an outlet, that would make more sense. But if your only purpose in creating the subclass is to add the outlet, then that doesn't, at least not as far as I can see.
> Now, what I would like to be able to do is to bind this outlet to a property I have exposed on the (File's Owner) controller class.
You don't bind an outlet, you merely connect it. And you connect it to an object, not a property of an object. Your choice of terminology makes me wonder if what you really want to do is create a new binding, which is a different kind of thing from an outlet.
Typically, for example, an outlet is connected to refer to an object, and that connection stays constant for the lifetime of the object which has the outlet. (This isn't required, of course, but it's more typical than having it be updated repeatedly over the lifetime of the object.) For example, the delegate of a window might be connected to the window's controller (which might be the File's Owner of the NIB containing the window).
> Is there any way I can get the outlet to be visible in the bindings sheet of the IB Inspector, so that I can make the binding, without having to go to the extent of making an IB plugin?
Again, you're conflating outlets and bindings.
Regards,
Ken
_______________________________________________
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