Re: Adding my own Properties for Objects
Re: Adding my own Properties for Objects
- Subject: Re: Adding my own Properties for Objects
- From: Shawn Erickson <email@hidden>
- Date: Thu, 15 Jan 2004 07:45:41 -0800
On Jan 14, 2004, at 6:36 PM, Mark Munz wrote:
To anyone that can help:
Is there a way to store a collection of Objects (in a Dictionary) in
any NSView or maybe an NSToolbarItem w/o having to subclass the object
specifically?
I'm looking for something similar to Properties under Carbon that can
be attached to Controls or Windows. Any control or Window can have
"properties" attached to them, making it easy to store additional data
without special handling.
Is this something that's already possible in Cocoa and I'm missing it?
Or am I asking for new functionality?
It sounds like you are attempting to attach model data directly to view
elements. That generally goes against the grain when using Cocoa (Cocoa
generally follows the MVC design pattern).
What are the "properties" that you are attempting to store and what are
they used for?
You could consider using an NSDictionary with the view element as the
key (I think that will work) and the value as the collection of your
"properties". However it is best to have a controller manage such
properties.
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.