Skip navigation.
 
mlcaching NSCollectionView
FROM : Georg Seifert
DATE : Mon Jun 23 22:05:10 2008

Hello again,

I have an other question:
Does anybody got saving the item views working. I filed a but at apple 
about this but i was curios if anyone found a workaround.

the problem is, that the stored NSCollectionViewItem does not retains 
the view:

in my NSCollectionView subclass:

- (NSCollectionViewItem *)newItemForRepresentedObject_:(id)object {
   myCollectionViewItem* item = [(myClass*)object item];
   
   if (item == nil) {
       item = (myCollectionViewItem*)[super 
newItemForRepresentedObject:object];
       [(myClass*)object setItem:item];
       [(myClass*)object setItemView:(myView*)item.view];
       

   } else {
       [item retain];
       [item setRepresentedObject:object];
       [item setView:[object itemView]];
       
   }
   NSLog(@"newItemForRepresentedObject:%@ layoutView: %@", item, [item 
layoutView]);
   return item;
}

in the log I get something like this:

<NSCollectionViewItem: 0xd655e50>{represented object: (null), view: 
(null) (frame {{-1.99813, 2.29293e-39}, {4.2039e-45, 3.36312e-44}}), 
selected: NO}

Does anyone has an idea?

Thanks for all your help.

Georg

Related mailsAuthorDate
mlcaching NSCollectionView Georg Seifert Jun 23, 22:05
mlRe: caching NSCollectionView I. Savant Jun 23, 22:10
mlRe: caching NSCollectionView Georg Seifert Jun 23, 22:21