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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/negm-awad%40cocoading.de

This email sent to [EMAIL PROTECTED]

Amin Negm-Awad
[EMAIL PROTECTED]




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to