• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stymied by NSCollectionView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stymied by NSCollectionView


  • Subject: Stymied by NSCollectionView
  • From: Andrew McClain <email@hidden>
  • Date: Sat, 15 Aug 2009 18:16:09 -0700

I've been reading docs and looking at IconCollection for the last week and I
still can't really figure this out.
Here's the behavior I want to model: pretend I'm making poker dice game. I
have a visual representation of the dice, and I want to select a certain
number of them each round.

Right now I'm using NSCollectionView with a prototype view that has a text
field (for a representation of the dice) and a button (for toggling
selection). Eventually I'll just use an image representation, but I'm just
trying to get this to work now.

When the user clicks the button in a view, the corresponding die will be
added into a "diceinhand" array in my AppController.
I can't figure out how, though, to connect the button in a way that
allows the AppController to understand which die has been selected
-- that is, I can't find any way to pass the representedObject associated
with my replicated view to any controller (but perhaps I'm thinking about
that incorrectly).

1. Can I call a selector on the representedObject itself from the view?
Where would I set that up that programmatically (I'm assuming you can't do
that with IB)?
2. Do I abandon the "selection buttons" and try and use the selection code
of NSCollectionView? Does that mean the user needs to shift-click to select
multiple dice? Do I programmatically bind the DiceInHand array in my
AppController to the selectedObjects key of my array controller or do I need
another array controller to manage that?

I'm happy to read docs, it just seems that everything I've been reading
deals mostly with binding values in a prototype view.

Thank you,
Andrew
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Turn off menu highlight in outline view?
  • Next by Date: Displaying an animated graph (= nodes and edges)
  • Previous by thread: Re: [SOLVED, with reservations] Re: Turn off menu highlight in outline view?
  • Next by thread: Stymied by NSCollectionView
  • Index(es):
    • Date
    • Thread