• 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 name must be same as ivar name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding name must be same as ivar name?


  • Subject: Re: Binding name must be same as ivar name?
  • From: Ricky Sharp <email@hidden>
  • Date: Thu, 24 Feb 2005 12:03:10 -0600

On Thursday, February 24, 2005, at 11:39AM, glenn andreas <email@hidden> wrote:

>The real power of "binding names need not correspond" isn't just "use a
>different name" but that you can have derived information bound and
>automatically updated when the data it is derived from changes.
>
>For example, if there are two integer ivars 'p' and 'q', you can have a
>binding corresponding to {p,q} being a valid hyperbolic tessellation:
>
>- (BOOL) isValidHyperbolicTessellation
>{
>	return (p - 2) * (q - 2) > 4;
>}
>
>and if you have:
>
>     [self setKeys: [NSArray arrayWithObjects: @"p", @"q", NULL]
>triggerChangeNotificationsForDependantKey:
>@"isValidHyperbolicTessellation"];
>
>in your classes +initialize method, and bind a text field with an error
>message who's "hidden" property is  bound to
>"isValidHyperbolicTesselation" then setting p or q will automagically
>update everything to cause the message to be hidden or not (or you
>could have it return an error message as an  NSString and bind to
>that).

Thanks for this followup, Glenn.  This is definitely very powerful and I can see the use of it for some of my more complex palette items.

--
Rick Sharp
Instant Interactive(tm)

 _______________________________________________
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

References: 
 >Re: Binding name must be same as ivar name? (From: Ricky Sharp <email@hidden>)
 >Re: Binding name must be same as ivar name? (From: "Sean McBride" <email@hidden>)
 >Re: Binding name must be same as ivar name? (From: Ricky Sharp <email@hidden>)
 >Re: Binding name must be same as ivar name? (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: Custom bindings in a control/cell pair
  • Next by Date: Re: Indexing/Directory Enumeration
  • Previous by thread: Re: Binding name must be same as ivar name?
  • Next by thread: Re: Binding name must be same as ivar name?
  • Index(es):
    • Date
    • Thread