Re: NSOutlineView
Re: NSOutlineView
- Subject: Re: NSOutlineView
- From: Ken Thomases <email@hidden>
- Date: Mon, 08 Sep 2014 18:25:41 -0500
Hi,
On Sep 8, 2014, at 6:00 PM, Charles Jenkins <email@hidden> wrote:
> I changed the relevant method to this:
>
> func outlineView(
> _outlineView: NSOutlineView!,
> objectValueForTableColumn tableColumn: NSTableColumn!,
> byItem item: AnyObject!
> ) -> AnyObject!
> {
> let node = getDocumentNodeFrom( item )
> return node
> }
>
>
> And in the particular NSTextFieldCell, I made sure “Bind to Table Cell View” was checked, and I set the model key path to objectValue.title.
Try binding the Value binding of the NSTextField itself, not its cell. The model key path looks right.
> class DocumentNode : NSObject {
>
> var title: String
> var content: NSAttributedString
> var children: [DocumentNode]
I haven't been following Swift closely enough to know: is String completely interchangeable with NSString? The text field's binding is going to expect to receive an Objective-C object. It should either be an NSString or an object on which it can call -description and get an NSString.
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