• 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
Re: NSCollectionView questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCollectionView questions


  • Subject: Re: NSCollectionView questions
  • From: David Carlisle <email@hidden>
  • Date: Mon, 11 Feb 2008 22:47:15 -0700

I didn't find another way to get the clicked menu item and the represented object into a method in the window controller for updating the menu.

On Feb 11, 2008, at 4:15 PM, Adhamh Findlay wrote:

Does subclassing NSCollectionView and NSCollectionViewItem make things easier, or is it a necessity?

Adhamh

On Feb 11, 2008, at 4:59 PM, David Carlisle wrote:

I needed to put a pop up menu inside a view of a NSCollectionViewItem, then customize the contents of the menu using the representedObject.

I subclassed NSCollectionViewItem and augmented setView to cause "self" to be the delegate of the NSPopUpButton menu, obtained with [view ViewWithTag:n].

That subclass has a method for MenuNeedsUpdate which passes the message to its NSCollectionView along with a copy of the representedObject.

My subclass of NSCollectionView has an IBOutlet for the Window Controller, so it can pass the message there where the menu can be customized.

Hope that helps,
DC

On Feb 11, 2008, at 2:19 PM, Dave Hayden wrote:

On Feb 9, 2008, at 6:21 AM, David Carlisle wrote:

I don't understand exactly what you are trying to do, but your workaround sounds more complicated that the ones I am using.

If I subclass the view used for the collection view items and put IBOutlets in those views, the references aren't retained when the item views are created. So I can't reference the subviews of that view by linking them with outlets and I can't get a reference from the view to the item controller object.


Can you describe your workaround?

Many thanks,
-Dave


_______________________________________________

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:
@adhamh.com


This email sent to email@hidden

_______________________________________________

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

_______________________________________________

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


References: 
 >NSCollectionView questions (From: Dave Hayden <email@hidden>)
 >Re: NSCollectionView questions (From: David Carlisle <email@hidden>)
 >Re: NSCollectionView questions (From: Adhamh Findlay <email@hidden>)

  • Prev by Date: Re: Adding obj-c++ file to carbon project changes preprocessed header file types
  • Next by Date: Re: Newb question: which feature am I looking for?
  • Previous by thread: Re: NSCollectionView questions
  • Next by thread: Re: NSCollectionView questions
  • Index(es):
    • Date
    • Thread