• 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: bindings with NSView subclass
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bindings with NSView subclass


  • Subject: Re: bindings with NSView subclass
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 23 Feb 2004 00:08:02 -0800

On Feb 22, 2004, at 8:40 PM, Alan Donsky wrote:
Anybody know how to make bindings work in a custom NSView?
Here is what i have done:
Called exposeBinding: in the views initialize method for the instance
variable i want to bind.

You don't need to do that unless you create an IB palette item for the view.

Written KVC compliant acceccors for the instance variable
Called bind:toObject:withKeyPath:options: in awakeFromNib to make the
binding to a controller,
It works pretty well in that changes to the model result in changes to
the view, but the problem is that if i make changes in the view, they
do NOT cause a change in the model. I am not sure how this is supposed
to work.

You need to conform to NSEditor:
http://cocoa.mamasam.com/COCOADEV/2004/01/2/82382.php

Still no good example for that one, I'm afraid...

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >bindings with NSView subclass (From: Alan Donsky <email@hidden>)

  • Prev by Date: Re: Speed comparison: compare:, methodForSelector: & CFNumberCompare()
  • Next by Date: Re: Weird bug in my code [long]
  • Previous by thread: bindings with NSView subclass
  • Next by thread: NSTableView [solved]
  • Index(es):
    • Date
    • Thread