Reputation: 3
I have the following class:
@interface QFormatRowData : NSObject
@property (copy) NSString *rowText;
@property (copy) NSString *completeAssetName;
@end
In the bindings inspector of NSTableColumn (inside an outline view and it contains a NSPopUpButtonCell), I binded Content to a array controller called FormatAs (which contains objects of class QFormatRowData) with controller key = arrangedObjects and model key path = rowText.
Then I binded Content values to the same "FormatAs" array controller with controller key = arrangedObjects and model key path = completeAssetName.
Then I binded Selected Object to a tree controller called "dstAssetTreeController" with Controller key = arrangedObjects and model key path = formatAssetName (which is a member in the treecontroller's class).
Now I want that the pop up button cell shows options as rowText but when selected, the value of completeAssetName is allocated to formatAssetName.
That is not happening with my bindings. How to fix this?
Upvotes: 0
Views: 69
Reputation: 15623
arrangedObjects
, no model key path.selectedObject
or selectedObjects
in place of the corresponding content object) to arrangedObjects
, model key path completeAssetName
.NSPopUpButtonCell
) to arrangedObjects
, model key path rowText
.dstAssetTreeController
, arrangedObjects
, model key path formatAssetName
.Documentation: NSPopUpButtonCell Bindings
Edit:
Xcode crashes when binding Content Objects. Workarounds:
NSTableView
and NSOutlineView
are deprecated. Convert to view-based.Upvotes: 0