Re: NSCollectionView questions
Re: NSCollectionView questions
- Subject: Re: NSCollectionView questions
- From: Adhamh Findlay <email@hidden>
- Date: Mon, 11 Feb 2008 17:15:31 -0600
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:
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