Is it possible to bind in IB with only one part of an array?

Good night all,

I was wondering, after a million tests and researching the google, if it was possible to bind the “ratioString” values from this variable:

property pixelAspectRatioList : {{ratioString:"Square (1.0)", ratioValue:1.0}, {ratioString:"D1/DV NTSC (0.9)", ratioValue:0.9}, {ratioString:"D4/D16 Standard (0.95)", ratioValue:0.95}, {ratioString:"D1/DV PAL (1.07)", ratioValue:1.07}, {ratioString:"D1/DV NTSC Widescreen (1.2)", ratioValue:1.2}, {ratioString:"HDV 1080/DVCPRO HD 720 (1.33)", ratioValue:1.33}, {ratioString:"D1/DV PAL Widescreen (1.42)", ratioValue:1.42}, {ratioString:"D4/D16 Anamorphic (1.9)", ratioValue:1.9}, {ratioString:"Anamorphic 2:1 (2.0)", ratioValue:2.0}, {ratioString:"DVCPRO HD 1080 (1.5)", ratioValue:1.5}}

to the contentValues of a NSComboBox? I have selected the app delegate, and tried this as a model key path : “pixelAspectRatioList.ratioString” and even though I though that would work, it totally crashes. I thought it was a path that was required here?

If it is not possible, it’s ok, but I was looking for a way to reuse the same property in different spots, without having to create a second one just for a UI element.

Thanks in advance!

Browser: Safari 531.22.7
Operating System: Mac OS X (10.6)

IB does use a path with a kind of dot notation, but the model key path has to be some property in your AS, and AS doesn’t use that kind of dot notation. You would have to create an array that would have all the values of ratioString and bind that to your comboBox. You could do that with this, for example:

set myArray to {}
		repeat with anEntry in pixelAspectRatioList
			set myArray to myArray & ratioString of anEntry
		end repeat

You can do it OK, but you probably need to use an array controller. Bind the array controller’s Content Array to your script with a model key path of pixelAspectRatioList, and then bind your combobox’s Content to the array controller with a Model Key Path of ratioString.

Well, many options here, but none as simple as creating a second property binded to the combo box it seems, so i think i’ll stick with that for now. Thanks everyone!

Browser: Safari 531.22.7
Operating System: Mac OS X (10.6)