• 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
bindings for a custom NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bindings for a custom NSView


  • Subject: bindings for a custom NSView
  • From: Paul Szego <email@hidden>
  • Date: Sun, 3 Apr 2005 10:59:52 +1200


Hi,

I'm writing a custom NSView to provide a graphical representation of some data that's in an NSArray. I've written indexed accessors in my document class, and can hook up an NSArrayController no problem.

If I wanted to use bindings to hookup my view, either through a controller or directly onto the document class (yes - I know that's not necessarily good, but it's not the point of this post), how much do I need to implement myself?

My first naive guess was that if everything was KVC and KVO compliant, I could issue issue the bind: call and the default implementation in NSObject would be fine. And this does seem to work - in a limited fashion - for simple properties (i.e. an object, scalar or to-one association). It doesn't seem to work for to-many properties.

After a lot of searching around I found statements to the effect that "there's nothing magic about bindings - the binding name is not simply the name of a KVC compliant property". It also seems the bindings made available in the app kit classes such as views and controllers have a lot of additional functionality that's been hand crafted - it's not all just magic from the default NSObject's default implementation.

So what, if anything, can I expect to get "for free" from the default implementations? Do I need to implement it all myself?

Thanks, Paul.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: bindings for a custom NSView
      • From: Scott Stevenson <email@hidden>
  • Prev by Date: Calling methods on other applications?
  • Next by Date: Re: Calling methods on other applications?
  • Previous by thread: Re: Calling methods on other applications?
  • Next by thread: Re: bindings for a custom NSView
  • Index(es):
    • Date
    • Thread