Re: View based outline view and custom NSTableCellViews
Re: View based outline view and custom NSTableCellViews
- Subject: Re: View based outline view and custom NSTableCellViews
- From: Uli Kusterer <email@hidden>
- Date: Fri, 07 Sep 2012 11:00:03 +0200
Jean,
I think your problem isn't the table, but that you're mixing up bindings and outlets. To connect an outlet, simply Control-Drag and hook it up. Use the little icons at the top of the inspector pane to switch to "Connections Inspector", which shows the list of all outlets, actions, bindings etc. and see it worked.
They're all connections, but the stuff in the Bindings Inspector that you are describing is not for IBOutlets. Outlets are specific object properties that point to objects in your XIB. Bindings are relationships that pass values between an object in your XIB and a (pretty much arbitrary) property of the object you bind to.
Now the object you bind to *can* be another object in your XIB, but it can also be the application, or the user defaults singleton, or an object referenced by one of the objects in your XIB (like the current selected object in your table view).
I know this stuff is similar, you'll just have to learn more about these two things to know how to tell them apart.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.com
On 06.09.2012, at 21:01, Jean Suisse <email@hidden> wrote:
> To add a few more informations:
>
> If I manually write the outlet declaration in MyTableCellView.h (@property(weak) NSTextField* myTextField); and if I add the @synthesize method in the .m file, this time, IB is letting me do the connection.
> However, IB is presenting me with a window I am not familiar with [1], requesting additional informations, related to bindings. So far, I haven't been able to make it work.
>
> Jean
>
> [1] such as Bind (set to DisplayPattern Value1), controller (set to My table cell view, the name of the view in IB), the name of the custom class (set to MyTableCellView), the keypath (set by default to objectvalue, the key should be here), the model object, set to MyTableCellView, an other keypath, set to MyTextField.
>
>
> On 6 sept. 2012, at 20:34, Jean Suisse wrote:
>
>> Thank you for your reply.
>>
>>> Elaborate on "not letting me do that."
>>
>> That is Ctrl + drag from the textfield I added in the TableCellView (declared to ID as MyTableCellView) towards the header file MyTableCellView.h (to declare the property + declare the outlet in one shot).
>> Also, if I create them manually, IB is refusing to do the connection.
>>
>>
>> Jean
>>
>>
>> On 6 sept. 2012, at 19:11, Seth Willits wrote:
>>
>>>
>>> On Sep 6, 2012, at 7:46 AM, Jean Suisse wrote:
>>>
>>>> Instinctively, I would create a subclass of NSTableCellView (MyTableCellView), set the NSTableCellView to be MyTableCellView in IB and connect all the outlets to be able to do this at runtime : [MyTableCellView.MyExtraTextField setXXXValue: …];
>>>
>>> That's exactly what you do.
>>>
>>>
>>>> But IB is not letting me do that. What did I miss ? They do that in the example provided by apple.
>>>
>>>
>>> I suspect you're grabbing the wrong thing in IB, or IB doesn't know about your cell view subclass etc. The usual things. It's like any other custom class stuff in IB, so there aren't any hidden tricks involved.
>>>
>>> Elaborate on "not letting me do that."
>>>
>>>
>>> --
>>> Seth Willits
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>>
>>> 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
>>
>
>
> _______________________________________________
>
> 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
_______________________________________________
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