Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Binding NSTabViews in NSCollectionViews?



I have the following very simple setup (project can be found at http://www.skia.net/media/tabbinding.zip) :

o MyController has but one ivar: NSArray *myNumbers
o myNumbers is assigned an array of NSNumbers (0,1,2,0,1,2...) in - wakeFromNib
o The app's nib instantiates MyController
o The app's window is completely filled with an NSCollectionView whose content property is bound to MyController.myNumbers
o NSCollectionView's NSCollectionViewItem's "view" outlet is connected to an NSTabView
o The NSTabView has three tabs. Its SelectedIndex property is bound to the representedObject of the NSCollectionViewItem
o Finally, each tab has a label in it. This label's value property is ALSO bound to the representedObject of the NSCollectionViewItem.


Here's what it looks like when run: http://www.skia.net/media/tabbinding.png

Note that NSTabView's binding of SelectedIndex works just fine. First the 0 index tab is selected, then the 1, then the 2, etc. etc. The trouble is the label.

Each tab should display the index number it is bound to in its label. In the picture above, only the first tab (index 0) is actually able to find the value it's bound to. The reason? That's the tab selected in IB!! If I select the second tab (index 1) in IB, I get the following:
http://www.skia.net/media/tabbinding2.png


For some reason, bindings of controls in the initial tab (the one selected in IB) work fine, but all the rest are dead. This only happens within an NSCollectionView. If drop my NSTabView on the window directly, all the bindings in all the tabs work.

Anybody know what NSCollectionView is doing with its NSCollectionViewItem behind the scenes that messes tab views up? I'm dumbfounded!

Many thanks,
-Joshua Emmons


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.