• 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: Binding (KVC/KVO) for C struct datatypes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding (KVC/KVO) for C struct datatypes


  • Subject: Re: Binding (KVC/KVO) for C struct datatypes
  • From: Charles Steinman <email@hidden>
  • Date: Thu, 4 Oct 2007 11:48:39 -0700 (PDT)

Apologies, Yahoo Mail decided to send my last message
before I actually wrote the third point. Here's what I
was trying to say:

--- Rudolph van der Merwe <email@hidden> wrote:

> I'm trying to create the following programatic
> binding:
>
> [view bind:@"frame.size.width" toObject:self
> withKeyPath:@"width" options:nil];

There are several problems with this:

1. KVC is a feature of Cocoa -- only Cocoa classes can
implement it. A C struct is not a Cocoa class, so you
can't use KVC to access its members.
2. You can't bind a keypath even if all the segments
in it are KVC-compliant. The binding argument has to
be an exposed binding of the object you're sending the
message to.
3. I don't believe "frame" is an exposed binding of
NSView, so you probably shouldn't try to bind it.

You could pretty easily create an NSImageView subclass
that allows this binding, but I would try reading up
on Bindings a little more first.

Cheers,
Chuck


      ____________________________________________________________________________________
Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
http://tv.yahoo.com/collections/3658
_______________________________________________

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

  • Follow-Ups:
    • Re: Binding (KVC/KVO) for C struct datatypes
      • From: Scott Stevenson <email@hidden>
References: 
 >Binding (KVC/KVO) for C struct datatypes (From: "Rudolph van der Merwe" <email@hidden>)

  • Prev by Date: Affine Transform, Bezier paths, cropping
  • Next by Date: [moderator] Please abide by the Leopard NDA - Re: Any one interested in my new framework from GSL?
  • Previous by thread: Re: Binding (KVC/KVO) for C struct datatypes
  • Next by thread: Re: Binding (KVC/KVO) for C struct datatypes
  • Index(es):
    • Date
    • Thread