Skip to content

Commit 8c89611

Browse files
juniorrantilatrflynn89
authored andcommitted
UI/AppKit: Make project buildable on macOS < 15
When trying to build Ladybird on macOS 14.3, it fails with the error: ``` No visible @interface for 'NSToolbar' declares the selector 'setAllowsDisplayModeCustomization:' (clang arc_may_not_respond) ``` This is caused by macOS < 15 not having the @interface definition for in NSToolbar for setAllowsUserCustomization:(BOOL). By dynamically calling the method, we can avoid the error altogether.
1 parent 6c71960 commit 8c89611

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

UI/AppKit/Interface/TabController.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ - (instancetype)init
9494
[self.toolbar setDelegate:self];
9595
[self.toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
9696
if (@available(macOS 15, *)) {
97-
[self.toolbar setAllowsDisplayModeCustomization:NO];
97+
if ([self.toolbar respondsToSelector:@selector(setAllowsDisplayModeCustomization:)]) {
98+
[self.toolbar performSelector:@selector(setAllowsDisplayModeCustomization:) withObject:nil];
99+
}
98100
}
99101
[self.toolbar setAllowsUserCustomization:NO];
100102
[self.toolbar setSizeMode:NSToolbarSizeModeRegular];

0 commit comments

Comments
 (0)