• 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: Scenarios I don't know how to use Bindings in
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scenarios I don't know how to use Bindings in


  • Subject: Re: Scenarios I don't know how to use Bindings in
  • From: "I. Savant" <email@hidden>
  • Date: Sat, 10 Feb 2007 01:34:53 -0500


From your description, it doesn't sound like it should require anything more than a standard master/detail bindings setup. If you haven't already, I suggest taking a long, hard look at the master/ detail bindings examples and adapting them to your own model.


WARNING: It's 1:30 AM locally and I may be missing something obvious. Take this with a whole bag of salt, not just a grain.

--
I.S.


On Feb 10, 2007, at 1:29 AM, Seth Willits wrote:

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:
40gmail.com


This email sent to email@hidden

_______________________________________________

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


  • Follow-Ups:
    • Re: Scenarios I don't know how to use Bindings in
      • From: Seth Willits <email@hidden>
References: 
 >Scenarios I don't know how to use Bindings in (From: Seth Willits <email@hidden>)
 >Re: Scenarios I don't know how to use Bindings in (From: "I. Savant" <email@hidden>)
 >Re: Scenarios I don't know how to use Bindings in (From: Seth Willits <email@hidden>)
 >Re: Scenarios I don't know how to use Bindings in (From: "I. Savant" <email@hidden>)
 >Re: Scenarios I don't know how to use Bindings in (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: Scenarios I don't know how to use Bindings in
  • Next by Date: Re: Scenarios I don't know how to use Bindings in
  • Previous by thread: Re: Scenarios I don't know how to use Bindings in
  • Next by thread: Re: Scenarios I don't know how to use Bindings in
  • Index(es):
    • Date
    • Thread