Mailing Lists: Apple Mailing Lists

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

Re: IB 3.1 breaks NSCollectionView bindings?



On Jul 30, 2008, at 10:46, Gerd Knops wrote:

I noticed that the bindings only fail for pre-existing objects, objects added after the xib was loaded work fine.

That lead me to a workaround: After loading the xib, I briefly set the content array that the NSArrayController which governs the NSCollectionView observes to nil and then back to the original value. Now the interface works as expected.

I am pretty sure the bug is within NSCollectionView's initialization. My guess is that the order of bindings in the nib control when the view template's bindings are established and when the CollectionView Item becomes valid. One way around it works, the other way around it does not.

FWIW, a very similar thing just happened to me (or rather to a co- worker to whom I had recommended the use of NSCollectionView for a particular piece of the interface). Same thing about editing the XIB file fixing or breaking the problem at different times.


I'm wondering if the problem is not in NSCollectionView's initialization, but in the handling of the view prototype's bindings. In our case, the NSCollectionView actually had the correct number of views (matching its content array), but items of the individual view bound through the collection view item with key "representedObject.someProperty" were not getting their values set.

I presume that when NSCollectionView creates an actual collection view item and view from the prototype objects, it has to mimic the bindings of the prototype view in the created view, so that the created view's bindings point to the view's own collection view item. Perhaps this is the step that's going wrong, in some way that's dependent on the order that the original bindings were encountered.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >IB 3.1 breaks NSCollectionView bindings? (From: Gerd Knops <email@hidden>)
 >Re: IB 3.1 breaks NSCollectionView bindings? (From: Jonathan Hess <email@hidden>)
 >Re: IB 3.1 breaks NSCollectionView bindings? (From: Gerd Knops <email@hidden>)
 >Re: IB 3.1 breaks NSCollectionView bindings? (From: Gerd Knops <email@hidden>)
 >Re: IB 3.1 breaks NSCollectionView bindings? (From: Gerd Knops <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.