Take out your PathControlItem subclass. Add a property on PathControl that maps the the path control item titles to your custom data (assuming each path control item has a unique title). Just change the code from my previous response to use the title as the dictionary key instead of NSURL if you aren't setting a URL.
//Add this to PathControl.
@interface PathControl : NSPathControl
//Set this.
@property NSDictionary<NSString*,Whatever*>*representedObjectsForPathItemTitles;
-(Whatever*)representedObjectForPathControlItem:(NSPathControlItem*)item;
@end
@implementation PathControl
-(Whatever*)representedObjectForPathControlItem:(NSPathControlItem*)item
{
return [self.representedObjectsForPathItemTitles objectForKey:item.title];
}
Unless your titles aren't unique, in which case you'd have to figure out another way to do this.
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: