Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mwxiao

macrumors regular
Original poster
Jul 5, 2007
228
5
CT
Hi,

I have a problem about how to use NSCollectionView. I can't select each item in the collection view. I check the box "selectable" in xib. But every time I click the CollectionView, all I can select is actually the Scroll View. No Item in the collection view is selected.

I check the connection and binding many times and pretty sure they are correct.

I attached a very simple example to illustrate my problem. Can anyone help me? It drives me crazy...

zip file:
http://tinyurl.com/yzvygpl
 
You have to implement the selection highlighting yourself with NSCollectionView. See the IconCollection example to see how you can use an NSBox to do this simply.
 
It's working, it's just that your view doesn't draw itself any differently when selected :)

Create a text field and bind its value to the array controller's selection.@count and you'll see it update.
 
It's working, it's just that your view doesn't draw itself any differently when selected :)

Create a text field and bind its value to the array controller's selection.@count and you'll see it update.

Thank you. But I still can't get the NSBox working...

I changed the prototype view to NSBox, and tried to draw a box background on the item I clicked. But nothing happens...

Can you take a look at the updated version?

http://tinyurl.com/yanzgev
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.