Using the Lazarus IDE and Free Pascal the following code works in previous macOS versions, but not in Monterey:
procedure TForm1.FormActivate(Sender: TObject);
begin
NSApp := NSApplication.sharedApplication;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
NSApp.dockTile.setBadgeLabel(NSStr('1'));
end;
Any ideas why it fails in Monterey? There are no related errors in the system console log.