• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSOutlineView (From: Charles Jenkins <email@hidden>)
 >Re: NSOutlineView (From: Ken Thomases <email@hidden>)
 >Re: NSOutlineView (From: Charles Jenkins <email@hidden>)

  • Prev by Date: Re: NSOutlineView
  • Next by Date: Re: NSUserDefaultsController in a NIB when not using standardUserDefaults
  • Previous by thread: Re: NSOutlineView
  • Next by thread: Bindings to enable a menu item based on an array's element count
  • Index(es):
    • Date
    • Thread