Skip to content

Commit c706a96

Browse files
committed
Fixed a crash on macOS <= 10.14: NSMenu.items is not writeable.
1 parent 585c53a commit c706a96

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Hot/Classes/ApplicationDelegate.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,17 @@ class ApplicationDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate
352352
}
353353

354354
self.sensorViewControllers = controllers
355-
self.sensorsMenu.items = items.sorted
355+
356+
self.sensorsMenu.removeAllItems()
357+
358+
items.sorted
356359
{
357360
$0.title.compare( $1.title, options: [ .numeric, .caseInsensitive ], range: nil, locale: nil ) == .orderedAscending
358361
}
362+
.forEach
363+
{
364+
self.sensorsMenu.addItem( $0 )
365+
}
359366
}
360367

361368
@IBAction

0 commit comments

Comments
 (0)