I have a NSCollectionView
that binds to a array controller. This array controller contains a list of NSDictionary
.
The items are of two types - defined in the dictionary - called header and item. If the type is header I will display a different view called headerView.
I got it working so far by putting this code in my NSCollectionViewItem
-subclass:
- (void)loadView {
[super loadView];
// If the represented object is a header, display the header view.
if ([[[self representedObject] objectForKey:@"type"] isEqualToString:@"header"]) {
[self setView:headerView];
}
}
The frame for the header is much smaller than the frame for an item. It is about half the height.
The problem is that both the header and the item get the same frame size (which is the larger frame). How can I make sure that the frame for the collection item is the same as it's view frame?