I am having a confounding problem.
After successfully following your guidelines above, I have proceeded to incorporate hierarchical outline views into an application that I am building.
The purpose of the App is to present users with a standard taxonomy of metadata to select from and then applies the validated metadata to documents within a desktop DAM program.
I am creating the hierarchical lists of Metadata Taxonomy as .plist files containing arrays:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Asset_Type</key>
<string>Marketing Publication</string>
<key>children</key>
<array>
<dict>
<key>Asset_Sub_Type</key>
<string>Press Release</string>
</dict>
<dict>
<key>Asset_Sub_Type</key>
<string>Annual Report</string>
</dict>
</array>
</dict>
</array>
</plist>
I am loading the plist into a property Variable named metaData01.
Here is the bare-bones AppDelegate script:
script LCCAppDelegate
property parent : class "NSObject"
property metaData01 : {}
property Asset_TypeOutlineView : missing value
property AssetTreeController : missing value
on applicationWillFinishLaunching_(aNotification)
set cFile to "/Development/MetaTagger/MetaTagger/assetTypePlistTest.plist"
loadPlist(cFile)
Asset_TypeOutlineView's setDoubleAction_("selectAssetType:")
Asset_TypeOutlineView's setTarget_(me)
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
on loadPlist(aFile)
set my metaData01 to current application's NSMutableArray's alloc()'s initWithContentsOfFile_(aFile)
end loadPlist
on selectAssetType_(sender)
log sender's itemAtRow_(sender's selectedRow())'s representedObject()
end selectAssetType_
end script
In Interface Builder, I have one Window and a Tree Controller.
The tree controller is bound to “App Delegate” with a Model Key Path of “metaData01”. The Key Paths: Children field is set to “children”.
The window contains a single Outline View. Within the Scroll View, the Table View has been set to contain a single column whose Value is bound to Tree Controller with Controller Key of “arrangedObjects” and Model Key Path of “representedObject”.
Every thing hooks up great, compiles and runs without error. When I double click on one of the top few lines of the Outline View, the log dutifully returns an array containing the proper clicked value.
HOWEVER…
There is no text visible whatsoever in the Outline View.
I see disclosure triangles for the sub-arrays, and clicking on rows properly highlights them, but the string values are not displayed, now matter what I try.
I must be missing something very obvious.
Any help would be greatly appreciated.
Sincerely,
- Desperate to Display Data