• 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
Too complex for bindings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Too complex for bindings?


  • Subject: Too complex for bindings?
  • From: Garaffa Dave <email@hidden>
  • Date: Thu, 02 Feb 2006 11:52:48 -0500

Too complex for bindings?

Imagine a window with 3 textfields and 3 popup menus where the values of both the textfield and popup menu would be filled in with bindings...

--------------------------------
My Dialog Window
--------------------------------
Some-text1: POPUP1
Some-text2: POPUP2
Some-text3: POPUP3

    [CANCEL] [OKAY]
--------------------------------

Next imagine two array controllers with the following:

Controller1  (an array of dicts)
------------
ARRAY
     DICT
           text-string        --> the value for Some-text1
           Choices           --> Connected to Controller2
     /DICT
     DICT
           text-string        --> the value for Some-text2
           Choices           --> Connected to Controller2
     /DICT
     DICT
           text-string        --> the value for Some-text3
           Choices           --> Connected to Controller2
     /DICT
/ARRAY
------------

Controller2 (just arrays for use in the popups)
-------------
ARRAY
      POP-CHOICE1-TEXT
      POP-CHOICE2-TEXT
      POP-CHOICE3-TEXT
      POP-CHOICE4-TEXT
/ARRAY
-------------
ARRAY
      POP-CHOICE1-TEXT
      POP-CHOICE2-TEXT
/ARRAY
-------------
ARRAY
      POP-CHOICE1-TEXT
      POP-CHOICE2-TEXT
      POP-CHOICE3-TEXT
/ARRAY
-------------

Remember Controller2 is connected to Controller1 so the data is really one prefs.plist in the end. The file itself looks something like this:

------------
ARRAY
     DICT
           KEY text-string /KEY
           STRING this is a test /STRING
           KEY Choices /KEY
            ARRAY
                  POP-CHOICE1-TEXT
                  POP-CHOICE2-TEXT
            /ARRAY
     /DICT
     DICT
... etc ...
... etc ...
     /DICT
/ARRAY
-----------------

Oh, the other problem is all of these interface elements will change based on the selection of an item in a listbox (connected to yet another controller).

Window looks something like this
---------------------------------------------
                   App Name
---------------------------------------------
- item1  -
- item2  -  textfield: popupbutton
- item3  -  textfield: popupbutton
- item4  -  textfield: popupbutton
- item5  -
----------------------------------------------

So depending on what item# the user clicks on (on the left hand side) the textfield values and popupbutton choices will change... Now, my problem is I can't think of any way to actually set up the bindings in IB (or programaticly) to actually make these binding connections... I was hoping for something like a Model Key Path that would look something like text-string[1] to access the 1st text string in the array so in the 'Some-text1' text field I could bind to the first 'text-string' in the array but that doesn't exist (as far as I can tell).

The only other way I came up with was individual 'controller1' and 'controller2' array controllers for each and every textfield/ popupbutton but for my actual project it's more like 21 textfields and 21 popups. So, having individual array controllers for each one would be SO ultra redundant and lets just say, less than elegant.

Anyway, if any of you binding gurus could come up with another way to skin this cat I be in your debt.

Dave

P.S. If I am forced into a last resort of having 42 different array controllers (really 21 of one type and 21 of the other type) would that be a problem application wise?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >drawing/graphing package (From: Dan Munk <email@hidden>)
 >Re: drawing/graphing package (From: Chad Weider <email@hidden>)

  • Prev by Date: Converting error codes to readable strings?
  • Next by Date: Re: Objective-C or Objective-C++
  • Previous by thread: Re: drawing/graphing package
  • Next by thread: Re: drawing/graphing package
  • Index(es):
    • Date
    • Thread