Re: Scenarios I don't know how to use Bindings in
Re: Scenarios I don't know how to use Bindings in
- Subject: Re: Scenarios I don't know how to use Bindings in
- From: Seth Willits <email@hidden>
- Date: Fri, 9 Feb 2007 22:29:55 -0800
On Feb 9, 2007, at 10:19 PM, I. Savant wrote:
On Feb 10, 2007, at 1:05 AM, Seth Willits wrote:
I'm going to guess that something like this is what I want? I'm
not entirely sure how that works.
Well, again, I'm not entirely sure I understand your current
approach, but if there's special stuff FileTypesManager does, then
why not add it to an NSArrayController subclass and move your "file
types preferences" mechanism to a pure bindings solution? You can
override -addObject: to do your file-types-specific magic, then
call super.
You said your FileTypesManager "manages an array (and some other
structures) of FileType objects" ... without a more thorough
description of what FileTypesManager does, exactly, it's not really
possible to give a solid answer as to how approach this problem
with Cocoa Bindings.
There's a flat array of all file types, then there's a dictionary
containing arrays of file types by the type of file. :)
In more words, a file type has a name (Plain HTML), extensions (html,
html), and then a type of file (text). (Another example would be PNG
Image, png, image.) The FileTypesManager keeps an array of all file
types (both Plain HTML and PNG Image etc), and then the dictionary
has an array for each type of file (one for text, one for image). So
in addFileType: and removeFileType: I'm simply doing extra work to
add to or remove from the appropriate array in the dictionary as well
as the main array with all file types in it. Also, the
FileTypesManager has accessors for asking for a file type given an
extension or name, or all file types based on type of file (ie, give
me all "text" file types).
--
Seth Willits
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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