MacOS, 10.15, Objective C.
I'm trying to update a functioning linear NSPathControl to not using deprecated cells. Simply replacing NSPathComponentCell by NSPathControlItem displays properly, but clickedPathItem doesn't work, aparantly because of the copy property. I need the index in the path array, so I tried indexOfObject using the clickedPathItem object and the pathItems array. No go. You can see why by looking at the following:
- (IBAction)pathControlSingleClick:(id)sender {
NSPathControlItem *pcc = [self.pathControl clickedPathItem];
if(pcc == nil)
return; // Path Control clicked, but nobody is home.
NSArray *items = self.pathControl.pathItems;
if(items == nil || [items count] == 0)
return; // Double CYA.
NSUInteger clickedIndex = [items indexOfObject:pcc];
[self.sftpManager.pathArray shortenToLength:clickedIndex];
[self updataPathComponentArray];
[self updateListing];
}
self | RTPServerUploadWindowController * | 0x1006100b0 | 0x00000001006100b0 |
pcc | NSPathControlItem * | 0x600000026840 | 0x0000600000026840 |
NSObject | NSObject | ||
_secretCell | NSPathComponentCell * | 0x600003303de0 | 0x0000600003303de0 |
cells | __NSArrayM * | @"3 elements" | 0x0000600000cf0810 |
[0] | NSPathControlItem * | 0x6000000269d0 | 0x00006000000269d0 |
NSObject | NSObject | ||
_secretCell | NSPathComponentCell * | 0x600003302080 | 0x0000600003302080 |
[1] | NSPathControlItem * | 0x600000026f30 | 0x0000600000026f30 |
NSObject | NSObject | ||
_secretCell | NSPathComponentCell * | 0x600003303de0 | 0x0000600003303de0 |
[2] | NSPathControlItem * | 0x600000025ca0 | 0x0000600000025ca0 |
NSObject | NSObject | ||
_secretCell | NSPathComponentCell * | 0x600003303b60 | 0x0000600003303b60 |
clickedIndex | NSUInteger | 9223372036854775807 |
The secretCells in the array do contain a matching item, but the NSPathControlIem objects do not. Any suggestions for a workaround? Bug report time?
Addendun: I tried asking for the URL of clickedPathItem, but got nil;