Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9199649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:34:56+00:00 2026-06-17T22:34:56+00:00

How do I make the NSCollectionView update to show the currently selected item using

  • 0

How do I make the NSCollectionView update to show the currently selected item using an NSBox? Displaying selection in a list seems like a basic thing, but I’m having all kinds of trouble with this.

I’ve read this question and also looked at the sample code from Apple. There seems to be several ways to do this.

  1. Using a subclasses of NSCollectionViewItem and special “prototype view”.
  2. Using a NSBox.

I wish to use the NSBox way since it seems simples and is also used in the official code sample.

It’s apparently done as described in the following quote by alternegro:

If a different background color will suffice as a highlight, you could
simply use an NSBox as the root item for you collection item view.
Fill the NSBox with the highlight color of your choice. Set the NSBox
to Custom so the fill will work. Set the NSBox to transparent.

Bind the transparency attribute of the NSBox to the selected attribute
of File Owner(Collection Item) Set the value transformer for the
transparent binding to NSNegateBoolean.

I’m stuck at the very first part: “use an NSBox as the root item for you (sic) collection item view”. I’ve tried to change the “Custom Class” to a FoobarBox that inherits from NSBox, but it doesnt seems to help as I cannot change the background color to blue nor can I bind the transparency. Any pointers on how to make the selection display in my NSCollectionVuew would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:34:57+00:00Added an answer on June 17, 2026 at 10:34 pm

    In XCode 4.5.2, you can just delete the NSView that comes automatically with the NSColletionView and drag in an NSBox (which will have all the appropriate bindings available). Make sure you re-bind the CollectionView to your new Box.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was using an NSCollectionView to show a list of pictures in the binded
to make multi download of files I need to use ZipFile class. Im using
I make an asynchronous http request using NSURLConnection every 11 seconds using a NSTimer
Make something like in html/css
make C++ functions or structs, classes (using meta-programming) determining maximum value for signed and
To make life difficult, the client I'm working for is using a really large
With Make, I do something like generated.c: input.txt generator ./generator input.txt > generated.c How
make ARCH=arm msm_defconfig make ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage -j4 I would like to build android
I make a simple application to take recipe info from websites like allrecipes.com. I'm
I make an application for querying from and inserting data to the database using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.