|
@@ -495,17 +495,20 @@ class KMSelectCell: NSTextFieldCell {
|
|
|
}
|
|
|
|
|
|
vc?.customBoxWidthLayoutConstraint.constant = width
|
|
|
- vc?.downCallback = { [unowned self] (downEntered: Bool, count: String) -> Void in
|
|
|
+ vc?.downCallback = { [weak self] (downEntered: Bool, count: String) -> Void in
|
|
|
+ guard let blockSelf = self else {
|
|
|
+ return
|
|
|
+ }
|
|
|
if downEntered {
|
|
|
- self.stringValue = count
|
|
|
+ blockSelf.stringValue = count
|
|
|
|
|
|
- let current = self.items.firstIndex(of: count) ?? 0
|
|
|
- self.indexOfSelectedItem = current
|
|
|
- self.delete?.km_comboBoxSelectionDidChange(self)
|
|
|
+ let current = blockSelf.items.firstIndex(of: count) ?? 0
|
|
|
+ blockSelf.indexOfSelectedItem = current
|
|
|
+ blockSelf.delete?.km_comboBoxSelectionDidChange(blockSelf)
|
|
|
|
|
|
- self.updateUI()
|
|
|
+ blockSelf.updateUI()
|
|
|
|
|
|
- self.createFilePopover.close()
|
|
|
+ blockSelf.createFilePopover.close()
|
|
|
}
|
|
|
}
|
|
|
vc?.viewWillShow = { [weak self] cellView, idx in
|