• 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: Problem binding NSTextView's attributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem binding NSTextView's attributedString


  • Subject: Re: Problem binding NSTextView's attributedString
  • From: Negm-Awad Amin <email@hidden>
  • Date: Thu, 31 Jul 2008 08:26:06 +0200


Am Mi,30.07.2008 um 22:36 schrieb Pete Callaway:

Hi,

This is probably a simple question, but I'm having a spot of bother
with a bound NSTextView.

In IB I've set the text view's attributedString to be bound to the
file's owner with a model key path of
"document.selectedPage.stringContent".
I assume, that you use a window controller.

This is fine but when my
document's selectedPage property changes, the NSTextView doesn't
update to show the stringContent of the new selectedPage.
Obviously you have a to-many relationship from document to pages. (Otherwise there would be no selectedPage property.) It is a good idea, to bind an array controller "pages controller" to this relationship and to use the selection property of the array controller. You can additionally bind the selection of the array controller to something in your document instance (selectionIndexes …), if you want to.

I've checked changes to selectedPage can be observed OK so I'm not
sure what I'm missing from the equation. Any tips?
I think, that your solution should work. I do not know, why it doesn't. Anyway: It is a better idea, to use an array controller for to-many relationships "between" the instance, owning the to-many relationship and the targeted instances (pages). Selection management is a typiscal task of bindings controller, esp. array controller.

Cheers,

Amin



Cheers,
Pete
_______________________________________________

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

Amin Negm-Awad email@hidden




_______________________________________________

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: Problem binding NSTextView's attributedString
      • From: "I. Savant" <email@hidden>
References: 
 >Problem binding NSTextView's attributedString (From: "Pete Callaway" <email@hidden>)

  • Prev by Date: Re: Distributed Objects "connection went invalid while waiting for a reply"
  • Next by Date: Re: Bindings to simulate spreadsheet functions in NSTableView?
  • Previous by thread: Problem binding NSTextView's attributedString
  • Next by thread: Re: Problem binding NSTextView's attributedString
  • Index(es):
    • Date
    • Thread