• 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 Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings Problem


  • Subject: Re: Bindings Problem
  • From: Camillo Lugaresi <email@hidden>
  • Date: Fri, 6 Jan 2006 00:50:41 +0100

On 06/gen/06, at 00:27, John McLaughlin wrote:

If I bind my NSTextField to A.B.status I can 'type' into the NSTextField and
it properly propogates down to the 'status' member variable in 'B' (So I
know it's bound properly)


However If I programatically change 'B' the UI never updates......

How do you change B? Do you change the variable directly or do you call the accessor?


1. Is this somehow expected behaviour (e.g. bindings only work one way
for objects in objects)?

No, it should work as long as the value is changed using a KVO- compliant method.


2. Is there a way I can post a notification in 'B' that the bound
value will notice something has changed? (thus avoiding making 'A' get
involved)... E.G. is it documented anywhere what should get posted and
could I throw this manually (via my code)

willChangeValueForKey: didChangeValueForKey:

But you don't need them if you use accessors to change the value.

3. ?? Anything else I should know

Make sure you read the KVO documentation.

Camillo

(PS: it's "propagate")
_______________________________________________
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 Problem
      • From: John McLaughlin <email@hidden>
    • Re: Bindings Problem
      • From: mmalcolm crawford <email@hidden>
References: 
 >Bindings Problem (From: John McLaughlin <email@hidden>)

  • Prev by Date: Re: Horizontally scrolling NSTextView in IB
  • Next by Date: Re: Core Data Binding: Unable to store a binary image (TIFF)
  • Previous by thread: Bindings Problem
  • Next by thread: Re: Bindings Problem
  • Index(es):
    • Date
    • Thread