Re: NSCollectionView and bindings to text fields in tab view

2008-08-13 Thread Gerd Knops


Can someone confirm that this is a bug in NSCollectionView or IB, or  
am I simply doing something wrong? If the former, can someone  
recommend a workaround? Should I, for instance, set the bindings  
programmatically?


I see the same behavior: If a NSTabView is used inside a  
NSCollectionView, only the bindings for the default tab are established.


Another bug is that depending on the somewhat random order IB saves  
bindings in, if the array controller already contains object when the  
nib loads, the bindings may or may not get established. A workaround  
is to briefly set the observed array to nil and back to it's original  
value after the nib was loaded.


Both bugs have been reported, the latter has been confirmed by Apple.

Gerd

___

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]


NSCollectionView and bindings to text fields in tab view

2008-08-13 Thread Hank Heijink (Mailinglists)

Hi all,

I'm having some trouble figuring out a bindings problem. I've made a  
litle test project that shows the problem (http://www.hankheijink.com/TestTextfieldBindings.zip 
, it's a 64Kb file). This is the structure of the project:


I've got an NSCollectionView wired up so that it gets its content from  
an NSArrayController. The NSArrayController is bound to an  
NSMutableArray in AppController, and the array contains CollectionItem  
objects. A CollectionItem object has one instance variable, value (an  
NSString). Apologies for the meaningless names.


The view of the NSCollectionViewItem contains a tab view with two  
tabs. Both of the tab view items contain a text field, and the value  
of the text field is bound to the keypath "representedObject.value" of  
the NSCollectionViewItems.


So, I should have a collection view containing views that have a tab  
view with two text fields, bound to the same string value.


Here's the problem: only one of the text fields gets bound, namely the  
one in the default tab. If I change the default tab to the other tab,  
that one gets bound. If I make two instance variables and bind the  
text fields to different ones, the same thing happens: only one of  
them is bound.


Looking around on the list archives, I've found that the bindings of  
NSCollectionView don't always work when set in IB. One suggestion was  
setting the NSArrayController content to nil and back to the mutable  
array in the AppController's awakeFromNib method, but that seems to  
solve a different problem (it didn't think it would solve mine and it  
didn't).


Can someone confirm that this is a bug in NSCollectionView or IB, or  
am I simply doing something wrong? If the former, can someone  
recommend a workaround? Should I, for instance, set the bindings  
programmatically?


Oh, and in case it matters, I'm using Mac OS 10.5.4, Xcode 3.1, and IB  
3.1.


Many thanks,
Hank

Hank Heijink
Columbia University

___

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]