10.5's collection view is, safe to say, kind of a train wreck. I've had to work around quite a few things. Your problem is solvable by asking the NSCollectionViewItem created for your new table element for its view and to have that view scrollRectToVisible: for its bounds.
If you need to get the ViewItem for a specific index (available via NSCollectionView's itemAtIndex: under 10.6), you'll need to go into "slightly undocumented" land and look at the collection view's _targetItems ivar. It contains the list of NSCollectionViewItems currently displayed in the collection view. Make sure you conditionalize this for 10.6 as _targetItems isn't there anymore. Hope that helps -- Jim http://nukethemfromorbit.com On Fri, Oct 16, 2009 at 9:32 AM, Half Activist <halfactiv...@gmail.com> wrote: > Hi, > I'm using a NSCollectionView to display a stack of items (a table) > but since what's display is far too complex to be laid out programmatically > I went for the NSCollectionView. And it's been all problems from the > beginning. > First of all with setContent that never worked no matter what I > did...it only works if I bind the content to an nsarraycontroller. > > Now, when I add a new item in this "table" i want to be able to > scroll it to the displayed area of the view, but the frameForItemAtIndex: > method only appeared in 10.6, so I decided to use the subviews and get the > frame this way, and now what did I discover: Suppose I have N items and > therefore N subviews in the NSCollectionView, after changing the array that > now contains N + 1 items, the nscollectionview has after the update N + N + > 1 subviews! > So, accessing subviews is not an option either. > > If anyone knows how to do fix these bugs, and how to disable the animation, > i'd be really glad. I'm considering writing an homebrew nscollectionview. > > regards. > _______________________________________________ > > 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/jturner.lists%40gmail.com > > This email sent to jturner.li...@gmail.com > _______________________________________________ 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 arch...@mail-archive.com