What I want to do is create a simple NSCollectionView in my application and populate it with images.
I have managed to design/link everything in Interface Builder and I try to load an array of whatever into the collection view so that it will display the view (nib-file) linked to it in the interface builder, but I had no luck so far. There is no way I can make to collection view display anything.
NSMutableArray * array = [[NSMutableArray alloc] init];
[array addObject:@"Test"];
[array addObject:@"Test"];
[array addObject:@"Test"];
[array addObject:@"Test"];
[array addObject:@"Test"];
[myCollectionView setContent:array];
I have followed 2 guides I found on Google but they seem to be deprecated, they wont work in Xcode 4.
I’m desperate please help me. I just want to make the NSCollectionView to display anything. I’m running Lion and xcode 4.1
I solved the problem.
In order for the NSCollectionView to show anything, the NSArray that you provide to it must have
nilas the last element.After that the NSCollectionView was displaying beautifully.